Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Ask how many items of shopping are needed.
- #Collect the items and store them in a list.
- #Loop through the shopping list and display them.
- #Show a total at the end so the user can see how many have been added
- count = 0
- shopping = []
- how_many = input("how many items of shopping do you have? ")
- how_many = int(how_many)
- for item_number in range(how_many):
- item = input("what is item number " + str(item_number) + "? ")
- shopping.append(item)
- count = count + 1
- output = str(count)
- print(output)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement