-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjessica_estore6.py
More file actions
39 lines (36 loc) · 1014 Bytes
/
Copy pathjessica_estore6.py
File metadata and controls
39 lines (36 loc) · 1014 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
37
38
39
userInput =int(input(Welcome to Jessica's E-Store! /n1. View Products /n2. Add to Cart /n3. Remove from Cart /n4. View Cart /n5. Checkout /n6. Exit))
match(userInput):
case 1 :
view_product()
case 2 :
add_to_cart()
case 3 :
case 4 :
case 5 :
case 6 :
case _ :
def view_product():
sellectedProduct = int(input(1. Laptop - $1000 /n2. Phone - $500 /n3. Headphones - $100))
match sellectedProduct:
case 1:
add_to_cart([1000],"Laptop - $")
case 2:
add_to_cart(["500",["Phone - $"])
case 3:
add_to_cart([100],["Headphones - $"])
case 4:
def add_to_cart(cart:list,products:int):
prices = []
product =[]
prices.append(cart)
procuct.append(products)
return f"{products} has been added to your cart"
def remove_cart():
sellectedProduct = int(input(1. Laptop - $1000 /n2. Phone - $500 /n3. Headphones - $100))
match sellectedProduct:
case 1:
add_to_cart([1000],"Laptop - $")
case 2:
add_to_cart(["500",["Phone - $"])
case 3:
add_to_cart([100],["Headphones - $"])