# Functions assigned to variables and stored in data structures in Python:
>>> def myfunc(a, b):
... return a b
...
>>> funcs = [myfunc]
>>> funcs[0]
<function myfunc at 0x107012230>
>>> funcs[0](2, 3)
5
# Functions returned as values from other functions in Python:
>>> def myfunc(a, b):
... return a b
...
>>> funcs = [myfunc]
>>> funcs[0]
<function myfunc at 0x107012230>
>>> funcs[0](2, 3)
5
# Functions can be passed as arguments to other functions in Python:
>>> def myfunc(a, b):
... return a b
...
>>> funcs = [myfunc]
>>> funcs[0]
<function myfunc at 0x107012230>
>>> funcs[0](2, 3)
5
#Python provides an intuitive way to do assignments and swapping in one line. Example -
x, y = 10, 20
print(x, y)
x, y = y, x
print(x, y)
Result:
10 20
20 10
🐍📰 How much faster does the application run when implemented with NumPy instead of pure Python? What about TensorFlow? Check out our in-depth review: realpython.com/numpy-tensorf…
#DoYouKnow❓ #Django follows the MVC pattern closely, however it does use its own logic in the implementation. Because the “C” is handled by the framework itself ... Django is often referred to as an MTV framework... bit.ly/2uF02VE