Python Lists

39 MCQs Covers list creation, indexing, properties (dynamic, ordered, mutable, heterogeneous, duplicates) and the append, insert, pop and remove methods. Includes code-output questions with answers checked by running the code, plus shared-reference lists and list applications.

MCQs

39 questions · 35 min · 39 marks

Want to try first? Take the free Computer Science test: SDLC and Waterfall Model

Sample questions

The first 5 of 39. Try each one, then tap to see the answer.

  1. Question 1

    What is a list in Python?

    • AA function to print data
    • BA data structure that stores multiple values in a specific order
    • CA mathematical operation
    • DA built-in module
    Show answer

    Answer: B

    A list stores multiple values in order, each at an index.

  2. Question 2

    Which symbol is used to create a list in Python?

    • A( )
    • B{ }
    • C< >
    • D[ ]
    Show answer

    Answer: D

    Lists are created with square brackets.

  3. Question 3

    What is the index of the first element in a list?

    • A0
    • B1
    • C-1
    • DAny number
    Show answer

    Answer: A

    Indexing starts at 0.

  4. Question 4

    Which function is used to insert an item at a specific position in a list?

    • Aappend()
    • Bpop()
    • Cinsert()
    • Dremove()
    Show answer

    Answer: C

    insert(index, item) adds an item at the given index.

  5. Question 5

    What does the append() method do in a list?

    • ARemoves an item
    • BAdds an item at the end
    • CAdds an item at a specific index
    • DSorts the list
    Show answer

    Answer: B

    append() adds a single item to the end.

More tests in Computational Structures

Practise with a free account

Save your scores, see which chapters need work, and keep a notebook of every question you got wrong.

Create free account