Ask Question
13 March, 12:17

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. 13 March, 14:55
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers