timpin

Untitled

Aug 13th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 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. print(shopping)
Advertisement
Add Comment
Please, Sign In to add comment