Question
8.3.3: Hourly temperature reporting.
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.
user_input = input()
hourly_temperature = user_input.split()
''' Your solution goes here '''
Asked By GalacticTraveler58 at
Answered By Expert
Carl
Expert · 1.0k answers · 1k people helped
Step 1/2
Steps to write the code is :
1. checking length of hourly_temperature is positive
2. printing the first value of hourly_temperature
3. looping from index 1 to end
4. printing the value of hourly_temperature at idnex
5. printing new line
Step 2/2
A python loop to print all elements in hourly_temperature. Separate elements with a -> surrounded by spaces is :
Final Answer
Output of the above python code is :
90 92 94 95
90 -> 92 -> 94 -> 95
🧑🏫 More Questions
👉 Interested in exploring further?
Chrome Extension
1. Search answers from our 90+ million questions database.
2. Get instantly AI Solutions powered by most advanced models like GPT-4, Bard, Math GPT, etc.
3. Enjoy one-stop access to millions of textbook solutions.
4. Chat with 50+ AI study mates to get personalized course studies.
5. Ask your questions simply with texts or screenshots everywhere.