From 5fc21c03f89255452eb9f2fb270f56884c7a42e6 Mon Sep 17 00:00:00 2001 From: Melissa Sanchez Date: Mon, 15 Jun 2026 16:15:09 +0200 Subject: [PATCH 1/4] githubtest --- .DS_Store | Bin 0 -> 6148 bytes lab-python-data-structures.ipynb | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..9e31874aa36bd7fc72ca711e47c14d936e53b29d GIT binary patch literal 6148 zcmeHKK~BR!474GKNL+fU#ElgXKcD!iZ{K&4VaYLy-e=Wyzm`U9>!g(on!7nCR} zM-DKSypy#(*<=oJEFwC8Ud==%B2vQ*B-*`7%`z!%W769ggT_7Sb4Jt6GT1E^F zI^wC+<$_&c&_(@Z+^3wZWkOLu9r5JlqB)Q&6`%q`1 Date: Mon, 15 Jun 2026 16:32:10 +0200 Subject: [PATCH 2/4] githubtest --- .DS_Store | Bin 6148 -> 6148 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.DS_Store b/.DS_Store index 9e31874aa36bd7fc72ca711e47c14d936e53b29d..d3bb206717d79f13482d75fa3be0f6a7ba75f240 100644 GIT binary patch delta 113 zcmZoMXfc?uEVgS70|NsKgC0XVLncE>ZoZ34QcivnP>iGS_5w47562x*ZoZ34QcivnP>iEYsa;h5!*NGc`4qhJ1sR6H c$@#ejKs^i$j2AWwGJa#5SirZLo#QV*0HIkO-2eap From bda91d073b03f130e0dd7e21b78af14960cdccd6 Mon Sep 17 00:00:00 2001 From: Melissa Sanchez Date: Mon, 15 Jun 2026 19:36:50 +0200 Subject: [PATCH 3/4] Update lab file --- .DS_Store | Bin 0 -> 6148 bytes ...ab-python-data-structures-checkpoint.ipynb | 349 ++++++++++++++++++ lab-python-data-structures.ipynb | 275 +++++++++++++- 3 files changed, 623 insertions(+), 1 deletion(-) create mode 100644 .DS_Store create mode 100644 .ipynb_checkpoints/lab-python-data-structures-checkpoint.ipynb diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..9e31874aa36bd7fc72ca711e47c14d936e53b29d GIT binary patch literal 6148 zcmeHKK~BR!474GKNL+fU#ElgXKcD!iZ{K&4VaYLy-e=Wyzm`U9>!g(on!7nCR} zM-DKSypy#(*<=oJEFwC8Ud==%B2vQ*B-*`7%`z!%W769ggT_7Sb4Jt6GT1E^F zI^wC+<$_&c&_(@Z+^3wZWkOLu9r5JlqB)Q&6`%q`1\n", + " Percentage of Products Ordered: % \n", + " ```\n", + "\n", + "9. Update the inventory by subtracting 1 from the quantity of each product. Modify the `inventory` dictionary accordingly.\n", + "\n", + "10. Print the updated inventory, displaying the quantity of each product on separate lines.\n", + "\n", + "Solve the exercise by implementing the steps using the Python concepts of lists, dictionaries, sets, and basic input/output operations. " + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "products = [\"t-shirt\", \"mug\", \"hat\", \"book\", \"keychain\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "inventory = {}" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdin", + "output_type": "stream", + "text": [ + "Please add the quantity for t-shirt 5\n", + "Please add the quantity for mug 9\n", + "Please add the quantity for hat 7\n", + "Please add the quantity for book 4\n", + "Please add the quantity for keychain 6\n" + ] + } + ], + "source": [ + "for product in products:\n", + " quantity = int(input(\"Please add the quantity for \" + product))\n", + " inventory[product] = quantity" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'t-shirt': 5, 'mug': 9, 'hat': 7, 'book': 4, 'keychain': 6}\n" + ] + } + ], + "source": [ + "print(inventory)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "customer_orders = set()" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Available products: ['t-shirt', 'mug', 'hat', 'book', 'keychain']\n" + ] + }, + { + "name": "stdin", + "output_type": "stream", + "text": [ + "Please enter your order here: book\n", + "Please enter your order here: hat\n", + "Please enter your order here: mug\n" + ] + } + ], + "source": [ + "print(\"Available products:\", products)\n", + "customer_orders = set()\n", + "for i in range(3):\n", + " product = input(\"Please enter your order here: \")\n", + " customer_orders.add(product)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'book', 'hat', 'mug'}" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "customer_orders" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3\n" + ] + } + ], + "source": [ + "total_products_ordered = len(customer_orders)\n", + "print(total_products_ordered)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "60.0\n" + ] + } + ], + "source": [ + "percentage_products_ordered = (total_products_ordered / len(products))*100\n", + "print (percentage_products_ordered)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(3, 60.0)\n" + ] + } + ], + "source": [ + "order_status = (total_products_ordered, percentage_products_ordered)\n", + "print(order_status)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Order Statistics:\n", + "Total products ordered: 3\n", + "Percentage of products ordered: 60.0%\n" + ] + } + ], + "source": [ + "print (\"Order Statistics:\")\n", + "print(\"Total products ordered:\", total_products_ordered)\n", + "print(\"Percentage of products ordered:\", str(percentage_products_ordered) + \"%\")" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'t-shirt': 5, 'mug': 9, 'hat': 7, 'book': 4, 'keychain': 6}\n" + ] + } + ], + "source": [ + "print(inventory)\n", + "for product in customer_orders:\n", + " inventory[product] -= 1" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'t-shirt': 5, 'mug': 8, 'hat': 6, 'book': 3, 'keychain': 6}" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "inventory" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "t-shirt : 5\n", + "mug : 8\n", + "hat : 6\n", + "book : 3\n", + "keychain : 6\n" + ] + } + ], + "source": [ + "for product in inventory:\n", + " print (product, \":\", inventory[product])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.13.5" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/lab-python-data-structures.ipynb b/lab-python-data-structures.ipynb index 5b3ce9e0..999e59f7 100644 --- a/lab-python-data-structures.ipynb +++ b/lab-python-data-structures.ipynb @@ -9,6 +9,19 @@ "# Lab | Data Structures " ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "vscode": { + "languageId": "plaintext" + } + }, + "outputs": [], + "source": [ + "#test GitHub" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -50,6 +63,266 @@ "\n", "Solve the exercise by implementing the steps using the Python concepts of lists, dictionaries, sets, and basic input/output operations. " ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "products = [\"t-shirt\", \"mug\", \"hat\", \"book\", \"keychain\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "inventory = {}" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdin", + "output_type": "stream", + "text": [ + "Please add the quantity for t-shirt 5\n", + "Please add the quantity for mug 9\n", + "Please add the quantity for hat 7\n", + "Please add the quantity for book 4\n", + "Please add the quantity for keychain 6\n" + ] + } + ], + "source": [ + "for product in products:\n", + " quantity = int(input(\"Please add the quantity for \" + product))\n", + " inventory[product] = quantity" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'t-shirt': 5, 'mug': 9, 'hat': 7, 'book': 4, 'keychain': 6}\n" + ] + } + ], + "source": [ + "print(inventory)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "customer_orders = set()" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Available products: ['t-shirt', 'mug', 'hat', 'book', 'keychain']\n" + ] + }, + { + "name": "stdin", + "output_type": "stream", + "text": [ + "Please enter your order here: book\n", + "Please enter your order here: hat\n", + "Please enter your order here: mug\n" + ] + } + ], + "source": [ + "print(\"Available products:\", products)\n", + "customer_orders = set()\n", + "for i in range(3):\n", + " product = input(\"Please enter your order here: \")\n", + " customer_orders.add(product)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'book', 'hat', 'mug'}" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "customer_orders" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3\n" + ] + } + ], + "source": [ + "total_products_ordered = len(customer_orders)\n", + "print(total_products_ordered)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "60.0\n" + ] + } + ], + "source": [ + "percentage_products_ordered = (total_products_ordered / len(products))*100\n", + "print (percentage_products_ordered)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(3, 60.0)\n" + ] + } + ], + "source": [ + "order_status = (total_products_ordered, percentage_products_ordered)\n", + "print(order_status)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Order Statistics:\n", + "Total products ordered: 3\n", + "Percentage of products ordered: 60.0%\n" + ] + } + ], + "source": [ + "print (\"Order Statistics:\")\n", + "print(\"Total products ordered:\", total_products_ordered)\n", + "print(\"Percentage of products ordered:\", str(percentage_products_ordered) + \"%\")" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'t-shirt': 5, 'mug': 9, 'hat': 7, 'book': 4, 'keychain': 6}\n" + ] + } + ], + "source": [ + "print(inventory)\n", + "for product in customer_orders:\n", + " inventory[product] -= 1" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'t-shirt': 5, 'mug': 8, 'hat': 6, 'book': 3, 'keychain': 6}" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "inventory" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "t-shirt : 5\n", + "mug : 8\n", + "hat : 6\n", + "book : 3\n", + "keychain : 6\n" + ] + } + ], + "source": [ + "for product in inventory:\n", + " print (product, \":\", inventory[product])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -68,7 +341,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.13.5" } }, "nbformat": 4, From e324bf210294a3d4a7f75798e5724cfd8ec7c5f4 Mon Sep 17 00:00:00 2001 From: Melissa Sanchez Date: Mon, 15 Jun 2026 19:48:25 +0200 Subject: [PATCH 4/4] Clean merge and resolve DS_Store --- .DS_Store | Bin 6148 -> 0 bytes .gitignore | 1 + 2 files changed, 1 insertion(+) delete mode 100644 .DS_Store create mode 100644 .gitignore diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 9e31874aa36bd7fc72ca711e47c14d936e53b29d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKK~BR!474GKNL+fU#ElgXKcD!iZ{K&4VaYLy-e=Wyzm`U9>!g(on!7nCR} zM-DKSypy#(*<=oJEFwC8Ud==%B2vQ*B-*`7%`z!%W769ggT_7Sb4Jt6GT1E^F zI^wC+<$_&c&_(@Z+^3wZWkOLu9r5JlqB)Q&6`%q`1