GATEverse Practice, past papers & mock tests
GATE 2026 · session-8
Programming, Data Structures and AlgorithmsProgramming in PythonmediumMSQ2 marks
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?

Select every correct option.

Save your progress

Related Programming, Data Structures and Algorithms PYQs