Write Python. Understand every error.

Starting Python in your browser…

Project

Weekly weather with NumPy

Store a week of temperatures in a NumPy array and find averages, extremes and hot days.

  1. Read seven temperatures on one line separated by spaces, store them in a NumPy array called temps, and print Average: followed by the mean rounded to 1 decimal place.
  2. Add Hottest: and Coldest: lines with the maximum and minimum temperatures (as they come from the array, for example 36.0).
  3. Use a Boolean mask to count the days warmer than the average, and print Days above average: followed by that count.

Ctrl + Enter to run
Line 1, column 1Tab indents 4 spaces. Press Esc then Tab to leave the editor.