Transcription 08/01/2026, 20:24:46
How is the lowest temperature calculated from the list?
Notes
**Python (Block 2, Part 2)** **Calculate statistics from the country’s monthly temperatures** Initialize the temperatures list with monthly temperatures. **Calculate lowest temperature:** Set `lowest` to the first item in the temperatures list. For each temperature in the temperatures list: - If the temperature is less than `lowest`, set `lowest` to that temperature. **Calculate highest temperature:** Set `highest` to the first item in the temperatures list. For each temperature in the temperatures list: - If the temperature is greater than `highest`, set `highest` to that temperature. **Calculate average temperature:** Initialize `sumTemperatures` to 0.0. For each temperature in the temperatures list: - Add the temperature to `sumTemperatures`. Set `temperature_average` by dividing `sumTemperatures` by the length of the temperatures list. **Output the results:** Output the lowest temperature. Output the highest temperature. Output the average temperature.
Study with interactive games
Upload your notes and generate flashcards, exams and more with AI
Start for free