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 बदलने की अनुमति देता है।
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