+2 votes
in Class 12 by kratos

Predict the output of the following code snippet:

ptr=40

def result():

print ptr

ptr=90

def func(var):

if var<=60:

ptr=30

print ptr

result()

func(60)

func(70)

1 Answer

+2 votes
by kratos
 
Best answer

UnboundLocalError: local variable ‘ptr’ referenced before assignment.

...