Report Bug

Qus

What will be printed?

x = 10
def f():
    x = 20
    print(x)
f()
print(x)
Qus

निम्न code का output क्या होगा?

x = 10
def f():
    x = 20
    print(x)
f()
print(x)


A. 10 10
B. 20 20
C. 20 10
D. Error


Solution
C. 20 10



Explanation
<p><span style="font-size: 14px;">The x inside f() is local (20), while the outside x remains 10.</span></p><p><span style="font-size: 14px;"><br></span></p><p><span style="font-size: 14px;">Function के अंदर x local variable है जिसकी value 20 है, जबकि global x की value 10 ही रहती है।</span></p>
Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad