You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print("Type DONE to quit, SHOW to see the current list, REMOVE to remove an item, and HELP.")
def remove_item(index):
target = int(index) - 1
item = shopping_list.pop(target)
print("Removed {}".format(item))
def show_list():
count = 1
for item in shopping_list:
print("{}: {}".format(count, item))
count += 1
print("Give me a list of things.")
show_help()
while True:
new_stuff = input("> ")
if new_stuff == "DONE":
print("Here's your list:")
show_list()
break
elif new_stuff == "HELP":
show_help()
continue
elif new_stuff == "SHOW":
show_list()
continue
elif new_stuff == "REMOVE":
show_list()
index = input("Which item? ")
remove_item(index)
continue
else:
new_list = new_stuff.split(",")
index = input("Add to a certain spot? Press enter for the end of the list. Or, give me a number. Current {} items in the list. ".format(len(shopping_list)))