Мой профиль
ACTIVITY 30 / 50

Measurement log

Try as many times as you need

Let’s understand

Built-in functions can process a list of numbers. sum adds them, min and max find the extremes, and len counts them. The mean is the sum divided by the count; this would not work for an empty list.

Listen to the explanation

Example

print(max([3, 8, 2]))
YOUR MISSION

Print the mean of measurements 2, 4, 6 using sum and len.

I need a hint

Put the numbers in a list and divide sum(readings) by len(readings).

How to find an error
  1. Read the last line of the error message.
  2. Find the indicated line. Check quotes, parentheses and indentation.
  3. Change one thing and run again.

main.py

4 spaces

Your draft stays in this browser.

Result

Python
Your program’s output will appear here. Click Run.