Computer Science

Which of the following statements are not correct?

(A) An element in a dictionary is a combination of key-value pair.

(B) A tuple is a mutable data type.

(C) We can repeat a key in a dictionary.

(D) clear() function is used to delete the dictionary.

  1. A, B, C
  2. B, C, D
  3. B, C, A
  4. A, B, C, D

Python Dictionaries

1 Like

Answer

B, C, D

Reason —

(B) Tuples are immutable data types in Python, meaning their values cannot be changed after creation.

(C) Dictionary keys must be unique, we cannot repeat a key in a dictionary.

(D) The clear() function is used to remove all elements from a dictionary, not to delete the dictionary itself.

Answered By

2 Likes


Related Questions