Lec 2 - Functions
-
from operator import add, mul
- 本质上是绑定函数到名称
- 因此,如果 写:add = 100, 此时 add(1, 10) 就不会返回函数,而是错误
- 如果要再使用 应重新绑定,或者事先 f = add, 后续使用f!

-
call expression 会事先求出参数值, 再进行调用
- 后续 Lec 4 - High Order Functions 关于if/else 有涉及
- ⚠️ python 从右往左求值,先求出等号右边再赋值
-
funtions
- pure:just return values
- non-pure: have side effects
-
print
- print 返回 None

- print 返回 None
