How to add a new Value to a Dictionary in Python

To add a new Value to a Dictionary in Python you can use one of the following ways.

Sample Python

myDict['key'] = 'value'

or

Sample Python

myDict = {'key':'value'}

Please Share us:
Please rate this snippet

4 thoughts on “How to add a new Value to a Dictionary in Python

Leave a Reply