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 SWhich of the following options is/are correct?
- (A)
f1andf2share the same listx - (B)
Output of Line Q is
[10, 20] - (C)
Output of Line R is
[10, 20, 30] - (D)
Output of Line S is
[10, 20, 40]
