Question: Hello. I have a pseudocode. Can you convert this code to PYTHON ? My code y=1 def sub1() y=2 def sub2() nonlocal y y=3 print(inner

Hello. I have a pseudocode. Can you convert this code to PYTHON ?

My code

y=1 def sub1() y=2 def sub2() nonlocal y y=3 print("inner value", y) sub2() print("outer value", y) sub1() print("global value:", y)

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!