मराठी

Which of the following statements is true about dictionaries in Python? - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

Which of the following statements is true about dictionaries in Python?

पर्याय

  • A dictionary is an example of sequence data type.

  • A dictionary cannot have two elements with same key.

  • A dictionary cannot have two elements with same value.

  • The key and value of an element cannot be the same.

MCQ
Advertisements

उत्तर

A dictionary cannot have two elements with same key.

Explanation:
  1. Unique Keys: In Python, dictionary keys must be unique. If you try to assign a value to an existing key, it simply overwrites the old value.
  2. Mapping Type: Unlike lists or tuples, a dictionary is a mapping datatype, not a sequence.
  3. Values: While keys must be unique, a dictionary can have multiple elements with the same value, and a key and its value can also be the same.
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2025-2026 (March) Set 4
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×