Question-23
python
lists
DA-2025
Consider the following Python declarations of two lists.
Which one of the following results in A = [1, 2, 3, 4, 5, 6]?
NoteAnswer
NoteSolution
A.append(B) will result in [1, 2, 3, [4, 5, 6]]. update is not a valid method for lists. insert is a valid method, but it requires two positional arguments, one is the index of the element to be entered and the other is the element itself. A.extend(B) extends the list by adding the elements of B to the end of A. It is an in-place operation.