This link talks about Python nested functions.
They have this example:
def num1(x):
def num2(y):
return x * y
return num2
res = num1(10)
print(res(5))
When I run it, it multiplies 10 by 5 and prints out 50. How does it "run"
res = num1(10)
... if the num1() function is only given a single argument of 10? y is not defined when num1(10) is run. The print function only executes when it runs res(5), but how are you "stuffing" two values into x in the parent function?
I'm thinking there's a bigger picture thing I'm not understanding in relation to how the function and order is running.
Thanks for looking at this beginner question. I'm just trying to understand... baby steps.
int,str,list,dictetc, they can be created inside a function, and returned from that function, and you can assign functions to whatever variables you want.