CBSE Class 11 Computer Science Question 6 of 88

Tuples and Dictionary — Question 6

Back to all questions
6
Question

Question 6

Assertion (A): The pop() method can be used to delete elements from a dictionary.

Reasoning (R): The pop() method deletes the key-value pair and returns the value of deleted element.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.
Answer

Both A and R are true and R is the correct explanation of A.

Explanation
The pop() method is used to delete elements from a dictionary. This method not only deletes the item specified by the key from the dictionary but also returns the deleted value.