Examveda

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)

A. x is 50
Changed local x to 2
x is now 50

B. x is 50
Changed local x to 2
x is now 2

C. x is 50
Changed local x to 2
x is now 100

D. None of the mentioned

Answer: Option A


This Question Belongs to Python Program >> Functions In Python

Join The Discussion

Related Questions on Functions in Python