Question 87

Which of the following is an invalid method/function in a Python dictionary?

  1. Apopitem ()
  2. Bremove ()
  3. Cget ()
  4. Dpop ()
Show answerHide answer

Correct answer: (B) remove ()

Explanation

Python dictionaries have pop(), popitem() and get(), but no remove() method. remove() belongs to lists and sets.

From DSSSB TGT Computer Science Practice Set 1

This is question 87 of DSSSB TGT Computer Science Practice Set 1. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.