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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -