-
Notifications
You must be signed in to change notification settings - Fork 0
/
shopping_list.py
executable file
·47 lines (35 loc) · 1009 Bytes
/
shopping_list.py
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
45
46
47
#have a help command
def show_help():
#print out instructions on how use app
print("what show we pick up at the store")
print("""
Enter Done to stop adding items
Enter Show to stop adding items
Enter Help to stop adding items
""")
def show_list():
#print out the list
print("Here's your list:")
for item in shopping_list:
print(item)
def add_to_list(new_item):
shopping_list.append(new_item)
print(f"Added {new_item}." +"List now has {} ".format(len(shopping_list)))
#make a list to hold onto our iyems
shopping_list = []
show_help()
while True :
#ask for new items
new_item=input("Entre new items:")
#add new items to our list
#be able to quit the app
if new_item == 'Done':
show_list()
break
elif new_item =='Help':
show_help()
continue
elif new_item == 'Show':
show_list()
continue
add_to_list(new_item)