Manipulating Dictionary Values Python -
i have dictionary following values.
d = {'a': 0, 'b': 1, 'c': 2} print d['c'] this print 2.
how go changing value given key word? when keyword 'c' given return besides 2.
just set using key:
>>> d = {'a': 0, 'b': 1, 'c': 2} >>> print d['c'] 2 >>> d['c'] = 9000 >>> print d['c'] 9000
Comments
Post a Comment