Advertisements
Advertisements
प्रश्न
Consider the code given below:
b=100
def test(a):
______________ # missing statement
b=b+a
print (a,b)
test (10)
print (b)
Which of the following statements should be given in the blank for #Missing Statement, if the output produced is 110?
विकल्प
global aglobal b=100global bglobal a=100
MCQ
Advertisements
उत्तर
global b
Explanation:
The global keyword allows the function to access the global variable b.
shaalaa.com
Scope of a Variable in Python
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
