Answers for "add new value dictionary python"

52

add new keys to a dictionary python

d = {'key':'value'}
print(d)
# {'key': 'value'}
d['mynewkey'] = 'mynewvalue'
print(d)
# {'mynewkey': 'mynewvalue', 'key': 'value'}
Posted by: Guest on November-27-2019

Code answers related to "add new value dictionary python"

Python Answers by Framework

Browse Popular Code Answers by Language