Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Input some integers to calculate their sum and average. \nInput 0 to exit")
- n = int(input())
- sum = 0
- count = 0
- while (n != 0):
- sum += n
- n = int(input())
- count += 1
- average = sum / count
- print("Average: %.2f" % average)
- print("Sum: %.2f" % sum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement