How to create a list of dictionaries in Python

Creating a list of dictionaries returns a list containing a specified number of empty dictionaries.

Solution for How to create a list of dictionaries in Python : You can use dict() and a list comprehension to create a list of dictionaries Call dict() to create a new dictionary. Use the syntax [dict() for number in range(n)] to create a list containing n empty dictionaries.


how-to-create-a-list-of-dictionaries-in-python