Question: Trace the output for the codes below: 1. def func_a(): print('inside func_a') 2. def f(y): y=y+3 x = 1 X += 1 print(x) print(y) 3.

 Trace the output for the codes below: 1. def func_a(): print('inside

Trace the output for the codes below: 1. def func_a(): print('inside func_a') 2. def f(y): y=y+3 x = 1 X += 1 print(x) print(y) 3. def f(x): x = x + 1 print('in f(x): x=',x) return x def func_b(y): print('inside func_b') return y def func_c(z): print('inside func_c") return z() def gly): print(x) print(x+1) def g(x): def h(x): x = x+1 print("in h(x): x = ", x) X = x + 1 print('in g(x): x = ',x) h(x) return x print(func_a()) print(5+func_b(2)) print(func_c(func_a)) def h(y): return x+1 x = 5;f(x) print('after call 1',x) x = 3;z = f(x) print('in main program scope: z=', z) print('in main program scope: x=', x) g(x);print('after call 2',x) h(x);print('after call 3',x) x = 3;z = g(x) print('in main program scope: x = ',x) print('in main program scope: 2 = ',z)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!