dict()
Built-in FunctionPython 2.0+Beginner
Creates a new dictionary
Quick Info
- Documentation
- Official Docs
- Python Version
- 2.0+
Learn by Difficulty
Quick Example
python
d = dict(name="Python", version=3) print(d) d2 = dict([("a", 1), ("b", 2)]) print(d2)
dict() is a built-in function that creates a new dictionary.
Try in PlaygroundTags
builtinfunctioncoredatatypemappingmutable