Question: Problem Statement: Read twelve temperature values (one for each month), and display the number of the month with the highest temperature. For example, according to
- Problem Statement: Read twelve temperature values (one for each month), and display the number of the month with the highest temperature. For example, according to http://worldclimate.com, the average maximum temperatures for Death Valley are (in order by month, in degrees Celsius):
18.2 22.6 26.4 31.1 36.6 42.2 45.7 44.5 40.2 33.1 24.2 17.6
- In this case, the month with the highest temperature (45.7 degrees Celsius) is July, and the program should display 7



Problem Statement: Read twelve temperature values (one for each month), and display the number of the month with the highest temperature. For example, according to http://worldclimate.com, the average maximum temperatures for Death Valley are (in order by month, in degrees Celsius): 18.2 22.6 26.4 31.1 36.6 42.2 45.7 44.5 40.2 33.1 24.2 17.6 In this case, the month with the highest temperature (45.7 degrees Celsius) is July, and the program should display 7. Step 2: Specify the loop condition. What is the condition of the loop? current month highestValue : # Check whether it is higher than the highest highestValue = nextValue # It is higher, so update the highest value highestMonth = current Month # Correspondingly, update the highest month # Print the highest month print(str(highestMonth) + was the highest month, with record temperature of "+ str(highestValue) + degrees Celsius")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
