sadennison

For loop with ave calc bot task

Feb 28th, 2020
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. elif command == "average":
  2. how_many = input("How many numbers> ")
  3. how_many = int(how_many)
  4. total = 0
  5. for number_count in range(how_many):
  6. number = input("Enter number " + str(number_count) + "> ")
  7. total = total + int(number)
  8. result = total / how_many
  9. print("the average = " + str(result))
Add Comment
Please, Sign In to add comment