How to Create a New Dictionary Using Dict() Constructor in Python


In this example we will show how to make a new dictionary using the dict() constructor in Python.

Source Code

mydict = dict(name="Jim", age="12", id=16)
print(mydict)

Output:

{'name': 'Jim', 'age': '12', 'id': 16}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments