`extend` adds every element of B to the end of A, giving [1, 2, 3, 4, 5, 6]. `append` would add B as a single element, giving [1, 2, 3, [4, 5, 6]]. Lists have no `update` method (that is for dictionaries and sets), and `insert` needs an index as well as a value.
More Programming in Python questions
GATE 2025 DA Q47– Consider the following Python code snippet. When the above program is executed, at the…
GATE 2025 DA Q63– Consider the following Python code snippet. The value printed by the code snippet is…
GATE 2024 DA Q38– Consider the following Python code: Which ONE of the following is the output of this code?
GATE 2024 DA Q39– Consider the function computeS(X) whose pseudocode is given below: Which ONE of the…
GATE 2024 DA Q41– Consider the following Python function: What does this Python function fun() do? Select…
GATE 2026 DA Q16– Consider the given Python program. Which of the following is the correct output of this…