Anyone know how to debug this program? Should be a very quick fix. Thanks!
#Make List ShoppingList = [] print ("Your shopping list is empty.") nextItem = input("What item do you want to add next: ") ShoppingList.append(nextItem) print ("Your shopping list contains: " ) for n in range (0, len(ShoppingList)): print (n + 1 , ". " , (ShoppingList[n])) while Option != 3: print("Do you want to:" + '\n' + " 1. Add an item" + '\n' + " 2. Remove an item" + '\n' + " 3. Quit") Option = int(input("Enter your choice: ")) while Option > 3 or Option < 1: Option = int(input("Not a valid choice, enter your choice: ")) if Option == 2: RemoveItem = input("What item would you like to remove? ") try: ShoppingList.remove(RemoveItem) except ValueError: print ("ERROR: Item is not on list") print ("------------------------" + '\n') print ("Your shopping list contains: " ) for n in range (0, len(ShoppingList)): print (n + 1 , ". " , (ShoppingList[n])) print ('\n') if Option == 1: nextItem = input("What item do you want to add next: ") ShoppingList.append(nextItem) print ("------------------------" + '\n') print ("Your shopping list contains: " ) for n in range (0, len(ShoppingList)): print (n + 1 , ". " , (ShoppingList[n])) print ('\n') FileObject = open("ShoppingList.txt" , 'w') for index in range (0, len(ShoppingList)): FileObject.write (str(ShoppingList[index] + "\n")) FileObject.close() print ("Bye!")