Advertisement
Guest User

Untitled

a guest
Feb 29th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #code by Lisa Noon#
  2. shopping = []
  3. #loop
  4. how_many = input("how many items of shopping do you have? ")
  5. # change str to int reusing variables name
  6. how_many = int(how_many)
  7. for item_number in range(how_many):
  8. true_item_number = item_number +1
  9. item = input("what is item number " + str(true_item_number) + "? ")
  10. shopping.append(item)
  11. #display the list
  12. print(shopping)
  13. # add on to the variable item number so that you get the correct ouput
  14. print ("You have " + str(true_item_number) + " things on your list ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement