Ask Question

6.5 Code Practice: Question 4 Edhesive

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

Sample Run

Enter Temperature: 27.6

Enter Temperature: 29.5

Enter Temperature: 35

Enter Temperature: 45.5

Enter Temperature: 54

Enter Temperature: 64.4

Enter Temperature: 69

Enter Temperature: 68

Enter Temperature: 61.3

Enter Temperature: 50

Sum = 504.3

+5
Answers (1)
  1. 26 August, 10:42
    0
    print ('Enter 10 temperatures')

    sum = 0

    for i in range (10):

    S = float (input ())

    sum = sum + S

    print ('The sum is: ', sum)

    First, we print a comment asking the ten temperatures, then we declare the variable sum = 0.

    We create a for cycle where the user must enter the temperatures, 10 in this case, then we must do the operation, summing the 10 numbers.

    In the last step, we print the result with the variable sum.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “6.5 Code Practice: Question 4 Edhesive Write a program that asks the user to enter ten temperatures and then finds the sum. The input ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers