Answers for "Python Write a program that asks the user to enter 3 numbers. Create variables called total and average that hold the sum and average"

0

Python Write a program that asks the user to enter 3 numbers. Create variables called total and average that hold the sum and average

print("Input some integers to calculate their sum and average. Input 0 to exit.")

count = 0
sum = 0.0
number = 1

while number != 0:
	number = int(input(""))
	sum = sum + number
	count += 1

if count == 0:
	print("Input some numbers")
else:
	print("Average and Sum of the above numbers are: ", sum / (count-1), sum)
Posted by: Guest on February-26-2021

Code answers related to "Python Write a program that asks the user to enter 3 numbers. Create variables called total and average that hold the sum and average"

Python Answers by Framework

Browse Popular Code Answers by Language