ACTIVITY 30 / 50
Try as many times as you needMeasurement log
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]))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
- Read the last line of the error message.
- Find the indicated line. Check quotes, parentheses and indentation.
- Change one thing and run again.
main.py
4 spaces
Your draft stays in this browser.
Result
PythonYour program’s output will appear here. Click Run.
Мой профиль