The chapter is iterating over a list using for loops The language is python I think I have the right idea but I need more explaining to figure out how to print the -> after every item except the last...


The chapter is iterating over a list using for loops


The language is python


I think I have the right idea but I need more explaining to figure out how to print the -> after every item except the last one since each list has a different length


Write a loop to print all elements in hourly_temperature. Separate elements with a -> surrounded by spaces.<br>Sample output for the given program with input: '90 92 94 95'<br>90 -> 92 -> 94 -> 95<br>Note: 95 is followed by a space, then a newline.<br>1 user_input = input()<br>2 hourly_temperature<br>3<br>user_input.split()<br>4 for index in range(len(hourly_temperture)):<br>if index !=<br>print(temp + '->'<br>else:<br>end<br>')<br>print(temp, end<br>')<br>

Extracted text: 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. 1 user_input = input() 2 hourly_temperature 3 user_input.split() 4 for index in range(len(hourly_temperture)): if index != print(temp + '->' else: end ') print(temp, end ')

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here