From fbe86fcb0c0a58688d255f065c2f919606cde3b7 Mon Sep 17 00:00:00 2001 From: Lautaro Date: Mon, 12 Jan 2026 15:25:54 +0100 Subject: [PATCH 1/6] Lautaro Solution From 372e6e63d0f8754dc36929d86d00a6a7c1d7abdb Mon Sep 17 00:00:00 2001 From: Lautaro Date: Mon, 12 Jan 2026 15:31:32 +0100 Subject: [PATCH 2/6] Update lab-python-data-structures.ipynb Lautaro Solution --- lab-python-data-structures.ipynb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lab-python-data-structures.ipynb b/lab-python-data-structures.ipynb index 5b3ce9e0..38df118e 100644 --- a/lab-python-data-structures.ipynb +++ b/lab-python-data-structures.ipynb @@ -21,16 +21,36 @@ "\n", "1. Define a list called `products` that contains the following items: \"t-shirt\", \"mug\", \"hat\", \"book\", \"keychain\".\n", "\n", + "products = [\"t-shirt\", \"mag\", \"hat\", \"book\", \"keychain\"]\n", + "\n", + "\n", "2. Create an empty dictionary called `inventory`.\n", "\n", + "inventory = {}\n", + "\n", "3. Ask the user to input the quantity of each product available in the inventory. Use the product names from the `products` list as keys in the `inventory` dictionary and assign the respective quantities as values.\n", "\n", + "\n", + "inventory = {\"t-shirt\" : \"25\", \"mug\" : \"10\", \"hat\" : \"1\", \"book\" : \"5\", \"keychain\": \"2\" }\n", + "\n", "4. Create an empty set called `customer_orders`.\n", "\n", + "customer_orders : ()\n", + "\n", + "\n", "5. Ask the user to input the name of three products that a customer wants to order (from those in the products list, meaning three products out of \"t-shirt\", \"mug\", \"hat\", \"book\" or \"keychain\". Add each product name to the `customer_orders` set.\n", "\n", + "\n", + "customer_orders : (\"t-shirt\", \"book\", \"hat\")\n", + "\n", + "\n", "6. Print the products in the `customer_orders` set.\n", "\n", + "customer_orders : (\"t-shirt\", \"book\", \"hat\")\n", + "\n", + "print (customer_orders)\n", + "\n", + "\n", "7. Calculate the following order statistics:\n", " - Total Products Ordered: The total number of products in the `customer_orders` set.\n", " - Percentage of Products Ordered: The percentage of products ordered compared to the total available products.\n", From 947282e1f8d13576568ca400c523d1ad3da766e2 Mon Sep 17 00:00:00 2001 From: Lautaro Date: Mon, 12 Jan 2026 15:50:41 +0100 Subject: [PATCH 3/6] Lau Day 1 --- lab-python-data-structures.ipynb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lab-python-data-structures.ipynb b/lab-python-data-structures.ipynb index 38df118e..60fb0b60 100644 --- a/lab-python-data-structures.ipynb +++ b/lab-python-data-structures.ipynb @@ -31,11 +31,17 @@ "3. Ask the user to input the quantity of each product available in the inventory. Use the product names from the `products` list as keys in the `inventory` dictionary and assign the respective quantities as values.\n", "\n", "\n", - "inventory = {\"t-shirt\" : \"25\", \"mug\" : \"10\", \"hat\" : \"1\", \"book\" : \"5\", \"keychain\": \"2\" }\n", + "quantity_tshirts = int(input (\"T-shirts quant: \"))\n", + "quantity_mag = int (input (\"mag quant: \"))\n", + "quantity_hat = int (input (\"hat quant: \"))\n", + "quantity_book = int (input (\"book quant: \"))\n", + "quantity_keychain = int (input (\"keychain quant: \"))\n", + "\n", "\n", "4. Create an empty set called `customer_orders`.\n", "\n", - "customer_orders : ()\n", + "\n", + "customer_orders : set ()\n", "\n", "\n", "5. Ask the user to input the name of three products that a customer wants to order (from those in the products list, meaning three products out of \"t-shirt\", \"mug\", \"hat\", \"book\" or \"keychain\". Add each product name to the `customer_orders` set.\n", From bc7cf399f37cecb9aa81f6ad8afda321cefbd675 Mon Sep 17 00:00:00 2001 From: Lautaro Date: Mon, 12 Jan 2026 16:39:44 +0100 Subject: [PATCH 4/6] Lau Day 1.1 --- lab-python-data-structures.ipynb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lab-python-data-structures.ipynb b/lab-python-data-structures.ipynb index 60fb0b60..346c5e79 100644 --- a/lab-python-data-structures.ipynb +++ b/lab-python-data-structures.ipynb @@ -32,29 +32,38 @@ "\n", "\n", "quantity_tshirts = int(input (\"T-shirts quant: \"))\n", + "inventory [\"t-shirt\"] = quantity_tshirts\n", + "\n", "quantity_mag = int (input (\"mag quant: \"))\n", + "inventory [\"mag] = quantity_mag\n", + "\n", "quantity_hat = int (input (\"hat quant: \"))\n", + "inventory [\"hat] = quantity_hat\n", + "\n", "quantity_book = int (input (\"book quant: \"))\n", + "inventory [\"book\"] = quantity_book\n", + "\n", "quantity_keychain = int (input (\"keychain quant: \"))\n", + "inventory [\"keychain\"] = quantity_bookchain\n", "\n", "\n", "4. Create an empty set called `customer_orders`.\n", "\n", "\n", - "customer_orders : set ()\n", + "customer_orders = set ()\n", "\n", "\n", "5. Ask the user to input the name of three products that a customer wants to order (from those in the products list, meaning three products out of \"t-shirt\", \"mug\", \"hat\", \"book\" or \"keychain\". Add each product name to the `customer_orders` set.\n", "\n", "\n", - "customer_orders : (\"t-shirt\", \"book\", \"hat\")\n", + "product = input (\"product_name\")\n", + "customer_orders.add (product)\n", + "\n", "\n", "\n", "6. Print the products in the `customer_orders` set.\n", "\n", - "customer_orders : (\"t-shirt\", \"book\", \"hat\")\n", "\n", - "print (customer_orders)\n", "\n", "\n", "7. Calculate the following order statistics:\n", From 20fba10eda2e38fe343463cbd46068de7caa02e1 Mon Sep 17 00:00:00 2001 From: Lautaro Date: Mon, 12 Jan 2026 16:49:18 +0100 Subject: [PATCH 5/6] Lau Day 1.2 --- lab-python-data-structures.ipynb | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/lab-python-data-structures.ipynb b/lab-python-data-structures.ipynb index 346c5e79..412a8bb6 100644 --- a/lab-python-data-structures.ipynb +++ b/lab-python-data-structures.ipynb @@ -21,7 +21,7 @@ "\n", "1. Define a list called `products` that contains the following items: \"t-shirt\", \"mug\", \"hat\", \"book\", \"keychain\".\n", "\n", - "products = [\"t-shirt\", \"mag\", \"hat\", \"book\", \"keychain\"]\n", + "products = [\"t-shirt\", \"mug\", \"hat\", \"book\", \"keychain\"]\n", "\n", "\n", "2. Create an empty dictionary called `inventory`.\n", @@ -34,8 +34,8 @@ "quantity_tshirts = int(input (\"T-shirts quant: \"))\n", "inventory [\"t-shirt\"] = quantity_tshirts\n", "\n", - "quantity_mag = int (input (\"mag quant: \"))\n", - "inventory [\"mag] = quantity_mag\n", + "quantity_mug = int (input (\"mug quant: \"))\n", + "inventory [\"mug] = quantity_mug\n", "\n", "quantity_hat = int (input (\"hat quant: \"))\n", "inventory [\"hat] = quantity_hat\n", @@ -44,7 +44,7 @@ "inventory [\"book\"] = quantity_book\n", "\n", "quantity_keychain = int (input (\"keychain quant: \"))\n", - "inventory [\"keychain\"] = quantity_bookchain\n", + "inventory [\"keychain\"] = quantity_keychain\n", "\n", "\n", "4. Create an empty set called `customer_orders`.\n", @@ -56,14 +56,30 @@ "5. Ask the user to input the name of three products that a customer wants to order (from those in the products list, meaning three products out of \"t-shirt\", \"mug\", \"hat\", \"book\" or \"keychain\". Add each product name to the `customer_orders` set.\n", "\n", "\n", - "product = input (\"product_name\")\n", - "customer_orders.add (product)\n", + "product1 = input (\"product_name\")\n", + "customer_orders.add(product1)\n", "\n", + "product2 = input (\"product_name)\n", + "customer_orders.add(product2)\n", + "\n", + "product3= unput (\"product_name)\n", + "customer_orders.add(product3)\n", "\n", "\n", "6. Print the products in the `customer_orders` set.\n", "\n", "\n", + "customer_orders = set ()\n", + "product1 = input (\"product_name\")\n", + "customer_orders.add(product1)\n", + "\n", + "product2 = input (\"product_name)\n", + "customer_orders.add(product2)\n", + "\n", + "product3= unput (\"product_name)\n", + "customer_orders.add(product3)\n", + "\n", + "print (customer_orders)\n", "\n", "\n", "7. Calculate the following order statistics:\n", From d635d4cb726a1b745185ee5caaa48db20a7aae93 Mon Sep 17 00:00:00 2001 From: Lautaro Date: Mon, 12 Jan 2026 17:43:17 +0100 Subject: [PATCH 6/6] Lau Day 1.3 --- lab-python-data-structures.ipynb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lab-python-data-structures.ipynb b/lab-python-data-structures.ipynb index 412a8bb6..7247098f 100644 --- a/lab-python-data-structures.ipynb +++ b/lab-python-data-structures.ipynb @@ -73,18 +73,29 @@ "product1 = input (\"product_name\")\n", "customer_orders.add(product1)\n", "\n", - "product2 = input (\"product_name)\n", + "product2 = input (\"product_name\")\n", "customer_orders.add(product2)\n", "\n", - "product3= unput (\"product_name)\n", + "product3= input (\"product_name\")\n", "customer_orders.add(product3)\n", "\n", "print (customer_orders)\n", "\n", "\n", "7. Calculate the following order statistics:\n", + "\n", " - Total Products Ordered: The total number of products in the `customer_orders` set.\n", + "\n", + "from customer_orders:\n", + "total_pedidos = len(customer_orders)\n", + "print(\"NĂºmero total de productos pedidos:\", total_pedidos)\n", + "\n", + "\n", " - Percentage of Products Ordered: The percentage of products ordered compared to the total available products.\n", + "\n", + "total_pedidos = len(customer_orders)\n", + "total_disponibles = len(inventory)\n", + "porcentaje_pedidos = (total_pedidos / total_disponibles) * 100\n", " \n", " Store these statistics in a tuple called `order_status`.\n", "\n",