Storing Function Reference in a Variable
Learn how to store the reference to a function in a variable. Also, observe how functions are treated as objects in Python.
We'll cover the following...
Variable vs. function initialization and usage
When you look at the way a variable is initialized and used in Python and compare it to the way a function is declared and used, you might easily assume that variables and functions are completely different things.
Press + to interact
a = 10def square(x):return x*xb = square(a)print(a)print(b) # prints 100
Looking at the code, ...