Question: what am i doing wrong? Write a loop to print all elements in hourly_temperature. Separate elements with a -> surrounded by spaces. Sample output for
what am i doing wrong?
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
user_input = input() hourly_temperature = user_input.split() hourly_temperature = [90, 92, 94, 95]
hourly_temperature = [90, 92, 94, 95 ] for temp in range(len(hourly_temperature)): if temp != len(hourly_temperature)-1: print(hourly_temperature[temp], "->", end = ' ' ) else: print(hourly_temperature[temp])
Expected output
-32 -> -35 -> -42
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
