Ask Question
12 October, 22:04

Write a program that creates an array called temperatures and then add five temperatures input from the keyboard. Then, print the array.

Sample Run

Enter a temperature: 45

Enter a temperature: 67

Enter a temperature: 89

Enter a temperature: 47

Enter a temperature: 89

[45, 67, 89, 47, 89]

+1
Answers (1)
  1. 12 October, 23:38
    0
    temperatures = []

    number1 = int (input ("Enter a temperature: "))

    number2 = int (input ("Enter a temperature: "))

    number3 = int (input ("Enter a temperature: "))

    number4 = int (input ("Enter a temperature: "))

    number5 = int (input ("Enter a temperature: "))

    temperatures. append (number1)

    temperatures. append (number2)

    temperatures. append (number3)

    temperatures. append (number4)

    temperatures. append (number5)

    print ("Enter a temperature: " + str (number1))

    print ("Enter a temperature: " + str (number2))

    print ("Enter a temperature: " + str (number3))

    print ("Enter a temperature: " + str (number4))

    print ("Enter a temperature: " + str (number5))

    print (temperatures)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a program that creates an array called temperatures and then add five temperatures input from the keyboard. Then, print the array. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers