Advertisement
David90278

Raspberry Pi - Programming 101 - Shopping List

Feb 23rd, 2020
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. shopping = []
  2.  
  3. how_many = input("how many items do you need to add to your shopping list? ")
  4. how_many = int(how_many)
  5.  
  6. for item_number in range(how_many):
  7.     item = input("what is the item number " + str(item_number + 1) + "? ")
  8.     shopping.append(item)
  9.    
  10. print(shopping)
  11. print("You have " + str(how_many) + " items in your shopping list")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement