Explore Courses Blog Tutorials Interview Questions
0 votes
in Python by (47.6k points)

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?

1 Answer

0 votes
by (106k points)

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 = {}

Related questions

Browse Categories