GATE DA 2025 Q23: Python lists: which call gives A = [1, 2, 3, 4, 5, 6]?
- Programming, Data Structures and Algorithms
- 1 mark
- MCQ
- −1/3 if wrong
Question
Consider the following Python declarations of two lists.
Which one of the following statements results in ?
Try it: multiple choice: exactly one correct option
Wrong answer costs 1/3 mark in GATE.
Show answer and explanation
Answer: A (official GATE 2025 final answer key)
Concept used: Python list methods: extend vs append.
First step: adds its argument as a single element (giving a nested list), lists have no method, and needs an index. Which method adds each element of B?
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2025 DA question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key
More Programming, Data Structures and Algorithms PYQs
- 2025 · Q18Hashing with linear probing: h(x) = 3x mod 10
- 2025 · Q27When does binary search run in O(log n)?
- 2025 · Q29Insertion sort with exactly two swaps: possible values of x
- 2025 · Q47Python sets in a while loop: which set ends up with "this"?
- 2025 · Q58Shortest paths: which edges cannot be in G?
- 2025 · Q63Python recursion: value of f(15, 10)