From 998dfdfd23c3ead0147c0fda18b80c00f82d2205 Mon Sep 17 00:00:00 2001 From: bperezlovisolo Date: Mon, 12 Jan 2026 15:24:47 +0100 Subject: [PATCH 1/4] Update lab-python-data-structures.ipynb test --- lab-python-data-structures.ipynb | 71 +++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/lab-python-data-structures.ipynb b/lab-python-data-structures.ipynb index 5b3ce9e0..218be444 100644 --- a/lab-python-data-structures.ipynb +++ b/lab-python-data-structures.ipynb @@ -50,11 +50,78 @@ "\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": null, + "metadata": {}, + "outputs": [], + "source": [ + "products = [\"t-shirt\", \"mug\", \"hat\", \"book\", \"keychain\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "inventory = {}" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "inventory [\"t-shirt\"] = int(input(\"Enter the quantity of t-shirts: \"))\n", + "inventory [\"mug\"] = int(input(\"Enter the quantity of mugs: \"))\n", + "inventory [\"hat\"] = int(input(\"Enter the quantity of hats: \"))\n", + "inventory [\"book\"] = int(input(\"Enter the quantity of books: \"))\n", + "inventory [\"keychain\"] = int(input(\"Enter the quantity of keychains: \"))" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "customer_orders = set()" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Customer order: {'book', 'hat', 'mug'}\n" + ] + } + ], + "source": [ + "customer_orders.add(input(\"Enter the first product you want to order: \"))\n", + "customer_orders.add(input(\"Enter the second product you want to order: \"))\n", + "customer_orders.add(input(\"Enter the third product you want to order: \"))\n", + "print(\"Customer order:\", customer_orders)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -68,7 +135,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.14.2" } }, "nbformat": 4, From 68e374d2a6035ab7043d12c74e84348157cffee4 Mon Sep 17 00:00:00 2001 From: bperezlovisolo Date: Mon, 12 Jan 2026 15:29:18 +0100 Subject: [PATCH 2/4] lab day 1 --- lab-python-data-structures.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lab-python-data-structures.ipynb b/lab-python-data-structures.ipynb index 218be444..85a2b009 100644 --- a/lab-python-data-structures.ipynb +++ b/lab-python-data-structures.ipynb @@ -116,7 +116,9 @@ "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "8. \n" + ] } ], "metadata": { From dd03196fca424fdd903be5c93083594bbdb9e6a3 Mon Sep 17 00:00:00 2001 From: bperezlovisolo Date: Mon, 12 Jan 2026 15:57:29 +0100 Subject: [PATCH 3/4] lab 1 - entrega final --- lab-python-data-structures.ipynb | 55 +++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/lab-python-data-structures.ipynb b/lab-python-data-structures.ipynb index 85a2b009..fab787cd 100644 --- a/lab-python-data-structures.ipynb +++ b/lab-python-data-structures.ipynb @@ -53,7 +53,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ @@ -71,7 +71,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ @@ -113,11 +113,58 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ - "8. \n" + "total_products_ordered = len(customer_orders)\n", + "percentage_ordered = (total_products_ordered / len(products)) * 100\n", + "\n", + "order_status = (total_products_ordered, percentage_ordered)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "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: \", percentage_ordered)" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Updated Inventory: {'t-shirt': 22, 'mug': 13, 'hat': 3, 'book': 10, 'keychain': 6}\n" + ] + } + ], + "source": [ + "inventory [\"t-shirt\"] = inventory [\"t-shirt\"] - 1 \n", + "inventory [\"mug\"] = inventory [\"mug\"] - 1 \n", + "inventory [\"hat\"] = inventory [\"hat\"] - 1 \n", + "inventory [\"book\"] = inventory [\"book\"] - 1 \n", + "inventory [\"keychain\"] = inventory [\"keychain\"] - 1 \n", + "\n", + "print(\"Updated Inventory:\", inventory)" ] } ], From 854a47498fe6d97c3fc584bec0ac8e8cd6b5c34b Mon Sep 17 00:00:00 2001 From: bperezlovisolo Date: Mon, 12 Jan 2026 16:03:44 +0100 Subject: [PATCH 4/4] lab 1 - entrega final --- lab-python-data-structures.ipynb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lab-python-data-structures.ipynb b/lab-python-data-structures.ipynb index fab787cd..7bca9ff3 100644 --- a/lab-python-data-structures.ipynb +++ b/lab-python-data-structures.ipynb @@ -146,14 +146,14 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 29, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Updated Inventory: {'t-shirt': 22, 'mug': 13, 'hat': 3, 'book': 10, 'keychain': 6}\n" + "Updated Inventory: {'t-shirt': 19, 'mug': 10, 'hat': 0, 'book': 7, 'keychain': 2}\n" ] } ], @@ -162,10 +162,17 @@ "inventory [\"mug\"] = inventory [\"mug\"] - 1 \n", "inventory [\"hat\"] = inventory [\"hat\"] - 1 \n", "inventory [\"book\"] = inventory [\"book\"] - 1 \n", - "inventory [\"keychain\"] = inventory [\"keychain\"] - 1 \n", + "inventory [\"keychain\"] = inventory [\"keychain\"] - 1\n", "\n", "print(\"Updated Inventory:\", inventory)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": {