Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Create and emty new list
- shopping=[]
- #Input how many items and convert from string to integer
- list=input("How many items on your shopping list")
- list=int(list)
- #add the items sequentially by cycling through
- for item in range(list):
- goods=input("What do you want to add to the list? ")
- shopping.append(goods)
- # calculate the number of items in the list and convert from interger to string
- number=len(shopping)
- number=str(number)
- #print the shopping listprint(shopping)
- print("There are "+number+" items in my shopping basket")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement