Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. count = 0
  2. num_sum = 0
  3. while True:
  4. try:
  5. user_input = input("Please choose a number: ")
  6. if user_input == "":
  7. break
  8. user_input = float(user_input)
  9. count += 1
  10. num_sum += user_input
  11. except ValueError:
  12. if user_input == "":
  13. break
  14. else:
  15. print("That is invalid.")
  16. print(count)
  17. print(num_sum)
  18. print(num_sum/count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement