Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #code by Lisa Noon#
- shopping = []
- #loop
- how_many = input("how many items of shopping do you have? ")
- # change str to int reusing variables name
- how_many = int(how_many)
- for item_number in range(how_many):
- true_item_number = item_number +1
- item = input("what is item number " + str(true_item_number) + "? ")
- shopping.append(item)
- #display the list
- print(shopping)
- # add on to the variable item number so that you get the correct ouput
- print ("You have " + str(true_item_number) + " things on your list ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement