Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- count = 0
- num_sum = 0
- while True:
- try:
- user_input = input("Please choose a number: ")
- if user_input == "":
- break
- user_input = float(user_input)
- count += 1
- num_sum += user_input
- except ValueError:
- if user_input == "":
- break
- else:
- print("That is invalid.")
- print(count)
- print(num_sum)
- print(num_sum/count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement