Consider the following Python dictionary: D = {1: 'Amar', 2: 'Akbar', 3:…

PYQ EMRS TGT/PGT (ESSE) 2025

Consider the following Python dictionary:
D = {1: 'Amar', 2: 'Akbar', 3: 'Anthony'}
Which of the following statements will perform an operation on dictionary D that is most similar to D.pop(2)?

  1. A.

    del D(2)

  2. B.

    del D[2]

  3. C.

    D.popitem(2)

  4. D.

    D.remove(2)

Attempted by 955 students.

Sign up free to check your answer

Sign up free

Explore the full course: Emrs Cs Tier 2

Loading lesson…