GATE 2026 Data Science and Artificial Intelligence question: Consider the given Python program. code Which of the following options is/are correct?
Consider the given Python program.
def outer():
x = []
def inner(val):
x.append(val)
return x
return inner
f1 = outer()
f2 = outer()
print(f1(10))
# Line P
print(f1(20))
# Line Q
print(f2(30))
# Line R
print(f1(40))
# Line S
Which of the following options is/are correct?
Show answer
Official answer: B,D