Ask Question

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]

+3
Answers (1)
  1. 15 May, 17:20
    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 & 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