Python Lists & Tuples MCQ Test: 200 Interview Questions With Answers

← All Python MCQ topics and your readiness dashboard

Test your Lists and Tuples knowledge with a timed Python MCQ mock test for interviews. Each attempt gives you 20 random questions in 20 minutes from a 200-question bank covering indexing and slicing, list methods and their time complexity, sort() versus sorted(), aliasing, shallow and deep copies, mutable default arguments, tuple packing and unpacking, hashability, namedtuple, deque, bisect and heapq, and list assertions for testers: order, duplicates, sorted UI lists and parametrized test data. 26 questions are written from a QA and test-automation angle and the rest from a developer angle; your result shows both scores.

What this Python MCQ test covers

Revise these lessons from the free Python tutorial before or after your test:

Sample Python Lists & Tuples questions with answers

  • Q. Comparing expected and actual lists in a test. What does this code print?
    expected = ["login", "cart", "pay"]
    actual = ["cart", "login", "pay"]
    print(expected == actual, sorted(expected) == sorted(actual))

    Answer: False True
    List equality is order sensitive; sort both when order does not matter.
  • Q. What does this code print?
    expected = ["a", "b", "c"]
    actual = ["a", "c"]
    print(sorted(set(expected) - set(actual)))

    Answer: ['b']
    A set difference shows exactly which expected items are missing.
  • Q. What does this code print?
    from collections import Counter
    expected = ["a", "a", "b"]
    actual = ["a", "b", "b"]
    print(Counter(expected) == Counter(actual))

    Answer: False
    Counter compares items with their counts, catching duplicates that sets would hide.
  • Q. What does this code print?
    nums = [10, 20, 30, 40]
    print(nums[1], nums[-1])

    Answer: 20 40
    Index 1 is the second item; -1 is the last.
  • Q. What does this code print?
    nums = [10, 20, 30, 40]
    print(nums[1:3])

    Answer: [20, 30]
    Slices include the start and exclude the stop.
  • Q. What does this code print?
    nums = [10, 20, 30, 40]
    print(nums[::2], nums[::-1])

    Answer: [10, 30] [40, 30, 20, 10]
    A step of 2 takes every other item; -1 reverses.

Every predict-the-output question in this bank was run on Python 3, so the answer is the real output. Go back to the Python MCQ dashboard to see your overall Python learning progress and interview readiness.

Frequently asked questions

How many questions does the Python Lists & Tuples MCQ test have?

The bank has 200 questions. Each test picks 20 at random, favouring questions you have not seen yet, so about 10 attempts cover the whole bank.

How long is each test and what is the pass mark?

Each test has a 20-minute timer and submits itself when time runs out. You pass with 70%, which is 14 of 20 correct.

Is this test useful for QA and automation engineer interviews?

Yes. 26 of the questions use test-automation scenarios such as parsing UI text, test data and assertions, and your result shows your QA score separately.

Can I retake the test?

Yes, as often as you like. Every retake draws a fresh set of 20 questions and counts toward your 20-test readiness target.