Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hi, I am a Marvin, your personal bot!")
- print("Let's get start it!")
- users_name=input("What is your name?")
- print("Hi, "+users_name+", Welcome!")
- print("Let´s make your shopping list")
- shopping = []
- how_many = input("How many items of shopping do you have? ")
- how_many = int(how_many)
- for item_number in range(how_many):
- # use input to ask the user for something to go on the shopping list
- item = input("What is the item number " + str(item_number) + "?")
- # agregar al final de la lista
- shopping.append(item)
- count = 0
- for item in shopping:
- print(item)
- count = count + 1
- result=str(count)
- print("You have " + result + " items in your shopping list")
- total=0
- print("Calculating cost average")
- print("How much does each item cost?")
- for number_count in range(how_many):
- number = input("Enter number "+str(number_count) + " > ")
- total= total + int(number)
- result = total / how_many
- print("The average = "+str(result))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement