Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...