Advertisement
JSoprano

Untitled

Oct 22nd, 2018
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. shopping = []
  2. count = 0
  3. how_many = input("How many shopping items do you require?")
  4. how_many = int(how_many)
  5.  
  6. for item_number in range(how_many):
  7. item_number = item_number + 1
  8. item = input("What is item number " + str(item_number) + "?")
  9. shopping.append(item)
  10. if item == " " or item == "":
  11. shopping.remove(item)
  12.  
  13. print("Your current list is as follows:")
  14.  
  15. for item in shopping:
  16. print(item)
  17. count = count + 1
  18.  
  19. print("You have a total of " + str(count) + " items in your shopping list")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement