forked from data-bootcamp-v4/lab-python-data-structures
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLab1.py
More file actions
36 lines (25 loc) · 849 Bytes
/
Lab1.py
File metadata and controls
36 lines (25 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
products = ["t-shirt", "mug", "hat", "book", "keychain"]
inventory = dict()
for prod in products:
inventory[prod] = int(input(f"{prod} quantity? in numbers: "))
print("\n\n",inventory,"\n\n",)
customer_orders = set()
for i in range(3):
prod = input(f"select your product: {products}")
customer_orders.add(prod)
print(customer_orders)
print(len(customer_orders))
total_products_ordered = len(customer_orders)
total_productos_available = len(products)
percentage_products_ordered = (total_products_ordered / total_productos_available) * 100
order_status = (total_products_ordered, percentage_products_ordered)
print(
f"""
Order Statistics:
Total Products Ordered: {total_products_ordered}
Percentage of Products Ordered: {percentage_products_ordered}
"""
)
for prod in customer_orders:
inventory[prod] -= 1
print(inventory)