Chapter 10 · Class 11 · CBSE · Science Computer Science

Tuples and Dictionaries

25 practice questions · 5 marks weightage

Topics in this chapter

  • Tuple Structure and Operations
  • Tuple Mutability and Hashability
  • Dictionary Construction and Updates
  • Dictionary Access and Traversal
  • Dictionary Semantics and Applications

Cheat sheet

Cheat Sheet

Practice questions

  1. Question 1Q-663C98

    Consider the following Python code: d = {"a": 1, "b": 2}; d["a"] = d["b"]. What will be the value of d after execution?

    1. A.{"a": 1, "b": 2}
    2. B.{"a": 2, "b": 2}
    3. C.{"a": 2, "b": 1}
    4. D.{"a": 1, "b": 1}
    See the answer and solution
  2. Question 2Q-506693

    Explain why t = (1, 2, [3, 4]) allows t[2].append(5) but does not allow t[2] = [3, 4, 5].

    See the answer and solution
  3. Question 3Q-0FB868

    What is printed by the following Python code? d = {"a": 10, "b": 20}; d["c"] = d.pop("a"); print(d["c"], len(d))

    1. A.10 2
    2. B.20 3
    3. C.10 3
    4. D.a 2
    See the answer and solution
  4. Question 4Q-27EFC4

    Why can a tuple sometimes be used as a dictionary key while a list cannot? Give one valid tuple-key example and one invalid list-key example.

    See the answer and solution
  5. Question 5Q-C01B21

    What is printed by the following Python code? t = (4, 7, 9, 7); print(t.index(7), t.count(7))

    1. A.0 2
    2. B.1 2
    3. C.1 1
    4. D.2 1
    See the answer and solution

20 more questions on Tuples and Dictionaries

Sign up free to practise the full chapter. Questions you get wrong come back until you've mastered them.

Start practising free

Free to start · No credit card needed