Unit 2 Task 2 - Solution

Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.

Solution - Task 2: Highest temperature this week

← Back to task


One possible program:

largest = None

for day_index in range(5):
    temp = float(input("Enter high temperature (C): "))
    if largest is None or temp > largest:
        largest = temp

print("Largest high temperature:", largest)