timpin

Untitled

Aug 13th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. shopping = []
  2.  
  3. how_many = input("How many items of shopping do you need? ")
  4. how_many = int(how_many)
  5.  
  6. for item_number in range(how_many):
  7. item = input("What is item number " + str(item_number +1) + "? ")
  8. # item_number starts at 0, most people start counting at 1;
  9. # even computer programmers, most of the time
  10. shopping.append(item)
  11.  
  12. for item in range(len(shopping)):
  13. print(shopping[item])
  14.  
  15. print("You have ",len(shopping)," items on your list")
Advertisement
Add Comment
Please, Sign In to add comment