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