‘dict()’ is used to create a dictionary.
Example
empDict = dict(name = "Krishna", age = 36, id = 1)
create_dict_using_dict_function.py
empDict = dict(name = "Krishna", age = 36, id = 1)
print(empDict)
Output
{'name': 'Krishna', 'age': 36, 'id': 1}
No comments:
Post a Comment