Jun-26-2018, 03:04 AM
g returns h, which is the function h itself, not a call to the function. That's fine, that's the way you usually do it. But when you print(g), you are printing the function g itself, not the result of a call to g. That's why you need to do
You are using a, b, and c both globally and inside the function h. But the a, b, and c in h and not the global a, b, and c that you have defined globally. They are the a, b, and c that you set as parameters in the def statements, and they are whatever is passed to the function. That means that
f(a)(b)(c)
. Let's step through it: f(a)
returns g, so you get g(b)(c)
. g(b)
returns h, so you get h(c)
, which returns 30.You are using a, b, and c both globally and inside the function h. But the a, b, and c in h and not the global a, b, and c that you have defined globally. They are the a, b, and c that you set as parameters in the def statements, and they are whatever is passed to the function. That means that
f(1)(2)(3)
will give you 6. I don't know if that's what you're expecting.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures