Advertisement
Chinedum

Untitled

May 25th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. count = 0
  2. shopping = []
  3.  
  4. how_many = input("how many shopping items ? ")
  5. how_many = int(how_many)
  6.  
  7. for item_number in range(how_many):
  8.     item = input("what is item number " + str(item_number) + "? ")
  9.     shopping.append(item)
  10.     count = count + 1
  11.     total_items = str(count)
  12. print(shopping)    
  13.  
  14. print("You have " + total_items + " items in your shopping list")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement