Computer >> Computer tutorials >  >> Programming >> Python

How to create an empty dictionary in Python?


You can create empty dictionary object by giving no elements in curly brackets in assignment statement. Empty dictionary object is also created by dict() built-in function without any arguments

>>> L1
[]
>>> d1 = {}
>>> d1
{}
>>> d1 = dict()
>>> d1
{}