-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshopping.py
More file actions
44 lines (28 loc) · 805 Bytes
/
shopping.py
File metadata and controls
44 lines (28 loc) · 805 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
40
41
42
43
44
shopping_list = []
def add_item():
item = input("\n Item to add: ")
shopping_list.append(item)
print("\n " + item + " has been added.")
def remove_item():
item = input("\n Item to remove: ")
shopping_list.remove(item)
print("\n " + item + " has been removed.")
def start():
print("\n Welcome to your shopping list.")
print(" Press (1) to view your list.")
print(" Press (2) to add an item.")
print(" Press (3) to remove an item.")
answer = input("\n > ")
if answer == "1":
for x in shopping_list:
print(x)
start()
elif answer == "2":
add_item()
start()
elif answer == "3":
remove_item()
start()
else:
start()
start()