Informatics Practices
To create a new dictionary with no items:
- Dict
- dict()
- d1={}
- Both 2 and 3
Python Dictionaries
2 Likes
Answer
Both 2 and 3
Reason — The function dict() and d1 = {} are both used to create a new dictionary with no items.
Answered By
3 Likes
Related Questions
In a dictionary, the elements are accessed through:
- key
- value
- label
- None of these
Keys of a dictionary must be:
- Similar
- Unique
- Both (i) and (ii)
- All of these
Which function is used to return a value for the given key?
- len()
- get()
- keys()
- None of these
Which function is used to remove all items from a particular dictionary?
- clear()
- pop()
- delete()
- rem()