Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hi, I am Marvin, your personal bot.")
- command = input("How can I help? ")
- if command == "average" :
- how_many_str = input("How many numbers> ")
- how_many_int = int(how_many_str)
- total = 0
- for number_count in range(how_many_int):
- number_str = input("Enter number " + str(number_count) + ">")
- total = total + int( number_str)
- result = total / how_many_int
- print ("the average = " + str (result))
- else:
- print ("Sorry, I don't understand")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement