Join free to take this lesson
Anyone can look around, but taking a lesson needs a free account. With one, your answers are checked step by step and your progress is saved, so you can stop and pick up where you left off on any device.
12 steps ยท about 25 min
By the end you can
- Loop over the items of a list with for
- Add up a list's items as you go
- Work out the mean as total รท len
- Use sum(list) / len(list)
- Build a list with append in a loop
Who it is for: Anyone who has done lesson 3.4, and physics lesson 1.5 (the mean of repeated measurements).
The steps
- A loop over a list
- Run it
- How many lines?
- Adding up as you go
- Add them up
- The mean
- The mean time
- A shortcut: sum
- Which line prints the mean?
- The mean in one line
- Build a list in a loop
- The loop and the shortcut
Discussion 0 comments
Log in to join the discussion.