01 / 07
A function was something you called
When you met def back in chapter 3, a function was something you called. You wrote double(5) and got an answer. That was the whole of it.
This chapter turns that round. A function is a value. It goes into a variable exactly as a number or a string does.
Look at f = double below. There are no parentheses after double. That alone makes f the same function as double.
def double(x): return x * 2f = doubleprint(f(5))Result
10