Definition
The dict() function creates a dictionary.
A dictionary is a collection which is unordered, changeable and indexed.
Syntax
dict(keyword arguments)
Parameters
Parameter | Description |
---|---|
keyword arguments | Required. Any number of keyword arguments, separated by comma: key = value, key = value ... |
Examples
myDict = dict(name = "Ivan", age = 26, country = "Russia")
print(myDict)