We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84b125e commit baac511Copy full SHA for baac511
shopping.py
@@ -0,0 +1,44 @@
1
+shopping_list = []
2
+
3
4
+def add_item():
5
+ item = input("\n Item to add: ")
6
+ shopping_list.append(item)
7
+ print("\n " + item + " has been added.")
8
9
10
+def remove_item():
11
+ item = input("\n Item to remove: ")
12
+ shopping_list.remove(item)
13
+ print("\n " + item + " has been removed.")
14
15
16
+def start():
17
+ print("\n Welcome to your shopping list.")
18
+ print(" Press (1) to view your list.")
19
+ print(" Press (2) to add an item.")
20
+ print(" Press (3) to remove an item.")
21
22
+ answer = input("\n > ")
23
24
+ if answer == "1":
25
+ for x in shopping_list:
26
+ print(x)
27
28
+ start()
29
30
+ elif answer == "2":
31
+ add_item()
32
33
34
35
+ elif answer == "3":
36
+ remove_item()
37
38
39
40
+ else:
41
42
43
44
+start()
0 commit comments