Python Add condition inside the loop, so the program adds only EVEN numbers. theSum = 0 count = 0 while True: number = input("Enter a number or press Enter to quit: ") if number == "": break theSum +=...


Python Add condition inside the loop, so the program adds only EVEN numbers.


theSum = 0
count = 0
while True:
number = input("Enter a number or press Enter to quit: ")
if number == "":
break
theSum += float(number)
count += 1


print("The sum is", theSum)
if count > 0:
print("The average is", theSum / count)



Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here