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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:00, Gaby702
Which is produced by the endocrine system to control how cells and organs function
Answers: 2
image
Computers and Technology, 22.06.2019 09:00, breella0
Howard is designing a chair swing ride. the swing ropes are 5 meters long, and in full swing they tilt in an angle of 29° outside chairs to be 2.75 m above the ground in full swing.
Answers: 1
image
Computers and Technology, 23.06.2019 06:00, sebcbal
When is a chart legend used a. all the time b. whenever you are comparing data that is the same c. whenever you are comparing multiple sets of data d. only for hand-drawn charts
Answers: 2
image
Computers and Technology, 23.06.2019 17:30, kenyasutton10
What are the most commonly found items in the trash according to the municipal solid waste report?
Answers: 1
You know the right answer?
Write a loop to print all elements in hourly_temperature. separate elements with a -> surrounded...

Questions in other subjects:

Konu
Mathematics, 31.01.2020 12:43
Konu
World Languages, 31.01.2020 12:43
Konu
Mathematics, 31.01.2020 12:43