Question: Scope defines where variables can be accessed. What variables are within the scope of the inner 2 function? def outer 1 ( i ) :

Scope defines where variables can be accessed. What variables are within the scope of the inner2 function?
def outer1(i): j = i +1 def outer2(): k = j +1 def inner1(): m = k +1 def inner2(): n = q + m +1 return n m = inner2() return m k = inner1() return k j = outer2() return j q =1 print ("outer1(1)=", outer1(1))
n, m, k, j, q
n, m, k, j, i
n, m, k, j, i, q
n, m, q

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 Programming Questions!