Home >>Python Built-in Functions >Python dict() Function
The Python dict() function is used to creates a dictionary which is unordered collection of data values , changeable and indexed. It is used to store data values like a map, which unlike other data types.
Syntax:dict(keyword arguments)
Parameter | Description |
---|---|
keyword arguments | It is a Required parameter. It is a keyword arguments you like, separated by comma: key = value, key = value ... |
c = dict(name = "Kanchan", age = 40, country = "India")
print(c)
R1 = dict({'a': 15, 'b': 10}, c=40)
R2 = dict({'x': 25, 'y': 35, 'z':50})
print(R1)
print(R2)