Given that d refers to a dictionary, change the value mapped to by the key 'Monty' to 'Python'. Write in Python
Answer:
The program to this can be given as:
Program:
d = {} #defining a dictionary.
d[ "Monty" ] = "Python" # assigning a value
#d={' Monty ': ' Python '}
print (d) #print value.
Output:
{'Monty': 'Python'}
Explanation:
Dictionary is an unordered data collection that is as opposed to other data types. In dictionary is a collection key and values. The key is a value that is pair as an element and value are stored in a map. The explanation of the above python program can be described as follows: