Python 3.7.4 (default, Aug 13 2019, 15:17:50) [Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin Type "help", "copyright", "credits" or "license" for more information. >>> def square(x): return x*x ... >>> square(5) 25 >>> cows = square >>> cows(5) 25 >>> # a function name is a variable name. ... # this name points at the code in memory that runs the function. ... >>> type(cows) >>> (base) MAC:Mon Sep 14:09:43:week3> vi table.py (base) MAC:Mon Sep 14:09:50:week3> python table.py 525 (base) MAC:Mon Sep 14:09:50:week3> !vi vi table.py (base) MAC:Mon Sep 14:09:56:week3> python table.py 525 [1, 2, 3, 4, 5, 6] (base) MAC:Mon Sep 14:09:56:week3> !vi vi table.py (base) MAC:Mon Sep 14:09:56:week3> !p python table.py 525 None (base) MAC:Mon Sep 14:09:56:week3> !vi vi table.py (base) MAC:Mon Sep 14:09:56:week3> !p python table.py 525
xf(x)
11
24
39
416
525
636
(base) MAC:Mon Sep 14:09:56:week3> !vi vi table.py (base) MAC:Mon Sep 14:09:58:week3> python Python 3.7.4 (default, Aug 13 2019, 15:17:50) [Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin Type "help", "copyright", "credits" or "license" for more information. >>> def square(x): return x*x ... >>> str(square( ... )) Traceback (most recent call last): File "", line 1, in TypeError: square() missing 1 required positional argument: 'x' >>> str(square) '' >>> (base) MAC:Mon Sep 14:10:00:week3> ls table.py (base) MAC:Mon Sep 14:10:00:week3> vi table.py (base) MAC:Mon Sep 14:10:00:week3> python table.py 525
xf(x)
11
24
39
416
525
636
xf(x)
0.10.010000000000000002
0.20.04000000000000001
0.30.09
0.40.16000000000000003
0.50.25
0.60.36
(base) MAC:Mon Sep 14:10:00:week3> ls table.py (base) MAC:Mon Sep 14:10:02:week3> vi pancakes.py (base) MAC:Mon Sep 14:10:03:week3> python pancakes.py {'x': 5} {'x': 5} 125 {'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x7f9fd8dc42d0>, '__spec__': None, '__annotations__': {}, '__builtins__': , '__file__': 'pancakes.py', '__cached__': None, 'square': , 'cube': , 'x': 5} (base) MAC:Mon Sep 14:10:04:week3>