GATEverse Practice, past papers & mock tests
GATE 2026 · session-8
Programming, Data Structures and AlgorithmsProgramming in PythonmediumMCQ1 mark
Consider the given Python program. def append_to_lst(val, lst=[]): lst.append(val) return lst print(append_to_lst(1)) print(append_to_lst(2)) print(append_to_lst(3, [])) Which of the following is the correct output of this program?
Save your progress

Related Programming, Data Structures and Algorithms PYQs