Oct-21-2020, 04:14 PM
(Oct-21-2020, 03:01 PM)deanhystad Wrote: An embedded function still needs to be called. f1() never calls f2() and f2() never calls f3().
I think there is an indentation error. f3() never returns a value. f2() returns c, which is a variable inside f3(). f1() has two returns and will never get to "return a". The code should look more like this:
def f1(x): def f2(x): def f3(x): return math.cos(x) return f3(x) * math.sin(x) return math.sqrt(f2(x))Code like this it should always be accompanied by a disclaimer.
"This code is written for the purposes of learning about embedded functions. Any use of this code would be a big mistake."
Thank you! but now what function do I call? to get a result.