Q. Predict the output of the following code:

 

a = 10

y = 5

def myfunc():

    y = a

    a = 2

    print("y =", y, "a =", a)

    print("a+y =", a + y)

    return a + y

print("y =", y, "a =", a)

print(myfunc())

print("y =", y, "a =", a)


 

Answer =

 

Output:-

y = 5 a = 10

Error

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post