Consider the following code:
x = 5
def test(a):
_________________ # Missing Statement
x = x + a
print(a, x)
test(3)
If the output produced is 3 8, which of the following statements should be given in the blank for the missing statement?
Options:
-
global a
-
global x
-
global x=5
-
global a=5
Answer:
Answer by student
b) global x
Detailed answer by teachoo
The rest of the post is locked. Join Teachoo Black to see the full post.