May 2018
Intermediate to advanced
380 pages
9h 37m
English
>>> def first_func(val): ... print(val) ... >>> new_name = first_func >>> first_func("Spam!") Spam! >>> new_name("Spam too!") Spam too!
>>> def mult(x, y): ... return x * y ... >>> def div(x, y): ... return x / y ... >>> def math(func, x, y): ... result = func(x, y) ... return result ... >>> math(mult, 4, 2) 8 >>> math(div, 4, 2) 2.0