?
What will be the output of the following Python code?
What will be the output of the following Python code?
x = 50
def func(x):
print('x is', x)
x = 2
print('Changed local x to', x)
func(x)
print('x is now', x)
x = 50
def func(x):
print('x is', x)
x = 2
print('Changed local x to', x)
func(x)
print('x is now', x)
Join the Discussion
Login to post a comment or share your explanation.
Login