Write a loop to print all elements in hourly_temperature. Separate elements with a -> surrounded by spaces. Sample output for the given program with input: '90 92 94 95' 90 -> 92 -> 94 -> 95 Note: 95 is followed by a space, then a newline

Respuesta :

The answer & explanation for this question is given in the attachment below.

Ver imagen ammary456

The program illustrates the use of loops or iterative statements.

Loops and iterations are used to perform repetitive operations.

The program in Python, where comments are used to explain each line is as follows:

#This gets input for all temperatures

temperature = input()

#This splits the temperatures by space

temps = strng.split( )

#This iterates through the list of all temperatures

for i in range(len(temps)):

   #This prints -> in front of all temperatures, except the last

   if i != len(temps)-1:

       print(temps[i],'->',end=" ")

   #This prints the last temperature, followed by a new line

   else:

       print(temps[i])

The program is implemented using a for loop

Read more about similar programs at:

https://brainly.com/question/24847242

ACCESS MORE