CBSE Class 12 Computer Science
Question 92 of 103
Working with Functions — Question 25
Back to all questions[1, 2, 3, [4]] [1, 2, 3, [4]]
In the code, the function increment appends [4] to list n, modifying it in place. When L = [1, 2, 3], calling increment(L) changes L to [1, 2, 3, [4]]. Variable M receives the same modified list [1, 2, 3, [4]], representing L. Thus, printing L and M results in [1, 2, 3, [4]], confirming they reference the same list. Therefore, modifications made to list inside a function affect the original list passed to the function.