Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. how_many = input("How many items of shopping do you have? ")
  2. how_many = int(how_many)
  3.  
  4. shopping = []
  5.  
  6. for item_number in range (how_many):
  7. item = input("What is the item number " + str(item_number) + "? ")
  8. shopping.append(item)
  9. print( )
  10. print("Your shopping list contains " + str(how_many) + " items which are:")
  11. print( )
  12.  
  13. count = 0
  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")
  20. print("Bye")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement