Berkeley CS 61A Lecture 2
http://inst.eecs.berkeley.edu/~cs61a/sp18/ CS 61A LECTURE 2 Names, Assignment , and User-Defined Function >> > f = max >> > f < built - in function max > >> > max < built - in function max > >> > f ( 1 , 2 , 3 ) 3 >> > max = 7 >> > f ( 1 , 2 , 3 ) 3 >> > from operator import add , mul >> > def square ( x ) : . . . return mul ( x , x ) . . . >> > square < function square at 0x000001FA67B15400 > >> > square ( 11 ) 121 >> > square ( add ( 3 , 4 ) ) 49 >> > square ( square ( 3 ) ) 81 >> > def sum_squares ( x , y ) : . . . return square ( x ) + square ( y ) . . . >> > sum_squares ( 3 , 4 ) 25 >> >