Week 2: Functions and expressions
Note: before you try an exercise in the interpreter, solve/explain it using paper and pen.
Consider the following functions:
def double(n): return n*2 def double_p(n): print n*2 >>> double(5) 10 >>> double_p(5) 10
Explain the difference between the two and why one of them is to be preferred over the other.
Do the exercises in
Chapter 2
.
Do the exercises in
Chapter 3
.