Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Type integers, each followed by Enter; or just Enter to finish!")
- total = 0
- count = 0
- while True:
- line = input("Integer: ")
- if line:
- try:
- number = int(line)
- except ValueError as err:
- print(err)
- continue
- total += number
- count += 1
- else:
- break
- if count:
- print("count =",count,"total =",total,"mean =",total/count)
- -----Error below ---
- Integer: 4
- Integer: 5
- Integer:
- invalid literal for int() with base 10: '\r'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement