Vidyalelo
Python · Q144

Functions in Python

Programming · Python · question 144

Q144

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
Answer
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

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board