Home >>Python Built-in Functions >Python dict() Function

Python dict() Function

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 Values

Parameter Description
keyword arguments It is a Required parameter. It is a keyword arguments you like, separated by comma: key = value, key = value ...
Here is an Example of Python dict() Function:

c = dict(name = "Kanchan", age = 40, country = "India")
print(c)

Output:
{'name': 'Kanchan', 'age': 40, 'country': 'India'}
Example 2:

R1 = dict({'a': 15, 'b': 10}, c=40)  
R2 = dict({'x': 25, 'y': 35, 'z':50})  
print(R1)  
print(R2)  

Output:
{'a': 15, 'b': 10, 'c': 40} {'x': 25, 'y': 35, 'z': 50}

Python Built-in Functions Python abs() Function Python all() Function Python any() Function Python ascii() Function Python bin() Function Python bool() Function Python bytearray() Function Python bytes() Function Python callable() Function Python chr() Function Python compile() Function Python complex() Function Python delattr() Function Python dict() Function Python dir() Function Python divmod() Function Python enumerate() Function Python eval() Function Python exec() Function Python filter() Function Python float() Function Python format() Function Python frozenset() Function Python getattr() Function Python globals() Function Python hasattr() Function Python hash() Function Python help() Function Python hex() Function Python id() Function Python input() Function Python int() Function Python isinstance() Function Python issubclass() Function Python iter() Function Python len() Function Python list() Function Python locals() Function Python map() Function Python max() Function Python memoryview() Function Python min() Function Python next() Function Python object() Function Python oct() Function Python open() Function Python ord() Function Python pow() Function Python print() Function Python property() function Python range() Function Python repr() Function Python reversed() Function Python round() Function Python set() Function Python setattr() Function Python slice() Function Python sorted() Function Python str() Function Python sum() Function Python super() Function Python tuple() Function Python type() Function Python vars() Function Python zip() Function
No Sidebar ads