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.
13 steps · about 25 min
By the end you can
- Say what def, the parameters, the body and return each do
- Call a function with your own numbers, in the right order
- Write the body of a function, indented, with return
- Read an IndentationError and fix it
Who it is for: Anyone who has done units 1 and 2 of this course (print, variables, if, for loops), and physics lessons 1.3 and 2.2 (converting units, speed).
The steps
- A first guess
- A formula with a name
- The parts of a function
- Which part gives the answer back?
- Run it
- Calling with your own numbers
- Call it yourself
- Order matters
- Writing the body
- Write the body
- An indentation error
- Your turn: falling speed
- Why bother?
Discussion 0 comments
Log in to join the discussion.