Question #101866

Write a program that asks the user to enter ten temperatures and then finds the sum. The input temperatures should allow for decimal values.

Expert's answer

print('Enter ten temperatures please')
sum = 0   #initialize variable for sum
for i in range(10):
    T = float(input()) #read user input
    sum = sum + T      #add current temperature value to sum
print('Sum is: ',sum)  #print result
LATEST TUTORIALS
APPROVED BY CLIENTS