Back
I want to build a dictionary in Python. However, all the examples that I see are instantiating a dictionary from a list, etc.
How do I create a new empty dictionary in Python?
For creating an empty dictionary you just need to call dict with no parameters
new_dict = dict()
or you have another choice which is a lot easier to write you just need to write as I have mentioned below:-
new_dict = {}
31k questions
32.8k answers
501 comments
693 users