subject

Write a loop to print all elements in hourly_temperature. Separate elements with a -> surrounded by spaces. Sample output for the given program: (must be in python) 90 -> 92 -> 94 -> 95
Note: There is a space after 95.

hourly_temperature = [90, 92, 94, 95]
for temp in hourly_temperature:
for index, temp in enumerate(str(temp)):
if index != len(temp)-1:
print(temp,'->',end=' ')
else:
print(temp, end='')
print('') # print newline

My expected out is:
90 -> 92 -> 94 -> 95
I keep getting:
90 -> 92 -> 94 -> 95 ->
NOTE: I can't edit the last line "print('') #print newline"

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
Awell-diversified portfolio needs about 20-25 stocks from different categories.
Answers: 2
question
Computers and Technology, 22.06.2019 21:30
Elements such as fonts colors visual structure graphics and the interface of a web page should complement each other to ensure blank
Answers: 3
question
Computers and Technology, 23.06.2019 06:00
Which statement is true of web-based social media? a.they allow consumers to interact with and update content. b.they cannot be updated easily, as compared to print media. c.they are expensive to produce and maintain, as compared to print and television. d.they can exist independent of the internet.
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
You know the right answer?
Write a loop to print all elements in hourly_temperature. Separate elements with a -> surrounded...
Questions
question
Biology, 14.12.2021 19:50
question
Mathematics, 14.12.2021 19:50
question
Arts, 14.12.2021 19:50
question
Mathematics, 14.12.2021 20:00