Informatics Practices
In a dictionary, the elements are accessed through:
- key
- value
- label
- None of these
Python Dictionaries
1 Like
Answer
key
Reason — In a dictionary, elements are accessed using keys, which uniquely identifies each element's associated value.
Answered By
1 Like
Related Questions
Which of the statement(s) is/are correct?
- In Python dictionary, the key-value pair is called an item.
- Python dictionary is a mapping of unique keys to values.
- Dictionary is mutable.
- All of these.
To create an empty dictionary, we use the statement as:
- d1 = {}
- d1 = []
- d1 = ()
- d1 == {}
Keys of a dictionary must be:
- Similar
- Unique
- Both (i) and (ii)
- All of these
To create a new dictionary with no items:
- Dict
- dict()
- d1={}
- Both 2 and 3