Report Bug

Qus

What will be printed?

x = 5
def f():
    global x
    x = 10
f()
print(x)
Qus

निम्न code क्या print करेगा?

x = 5
def f():
    global x
    x = 10
f()
print(x)



A. 5
B. 10
C. Error
D. None


Solution
B. 10



Explanation
global x allows the function to modify the global variable. <br><br> global x function को global x की value बदलने की अनुमति देता है।
Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad