(Solved):In Python, write a loop to print all elements in hourly_temperature. Separate elements with a – surrounded by spaces. Sample output for the given program: 90 – 92 – 94 – 95 Note: There is a spa View Answer…

 

Question

In Python, write a loop to print all elements in hourly_temperature.

Separate elements with a -> surrounded by spaces.

Sample output for the given program: 90 -> 92 -> 94 -> 95

Note: There is a space after 95.

 

EXPERT ANSWER

By taking advantage of the array being iterable, using i as an iterator, we can check if we’re at the last element by checking if i is equal to len(array) – 1, if this

Scroll to top