Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Shopping Program that
- 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.
- """
- shopping=[]
- items=int(input("How many items do you need? "))
- for item_number in range(items):
- item=input("What is item number "+str(item_number)+"? ")
- item_number+=1
- shopping.append(item)
- if item_number==1:
- print("You have added",item_number,"item in your cart namely",shopping[0])
- else:
- print("You have added",item_number,"items in your cart, here is a list:")
- for element in shopping:
- print(element)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement