• Register
Welcome to Kodlogs, programming questions and answer website.
+1 vote
8 views
given that d refers to a dictionary, change the value mapped to by the key 'monty' to 'python'.
by (390 points)  

1 Answer

0 votes

If d is your dictionary object, simply do d['key'] = 'value'

Example below:
d = {'monty':'value','xyz':'abc'} // example dictionary
print(d['monty'])  // prints "value"
d['monty'] = 'python'  // value changed to python
print(d['monty'])   //prints python 
by (220 points)  
...