CBSE · 083Class XII · 2024Section A1 mark

Question 12

2 April 2024 · Computer Science (083)

Observe the given Python code carefully :

python
a = 20
def convert(a):
    b = 20
    a = a + b
convert(10)
print(a)

Select the correct output from the given options :

Answer

(b) 20

Explanation

The variable 'a' inside the function is local and does not affect the global variable 'a', which remains 20.