Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 21, 2017 in Python by anonymous
0 votes
0 answers
asked Apr 12, 2017 in Python by anonymous
0 votes
1 answer
asked Apr 18, 2017 in Python by anonymous
BJSHUB - is a place to gain and share knowledge. It's a platform to ask questions and connect with people who contribute unique insights and quality answers.

Add new keys to a dictionary?

0 votes
asked Jul 21, 2017 in Python by anonymous

1 Answer

0 votes
>>> d = {'key':'value'}
>>> print d
{'key': 'value'}
>>> d['mynewkey'] = 'mynewvalue'
>>> print d
{'mynewkey': 'mynewvalue', 'key': 'value'}
answered Jul 21, 2017 by anonymous
...