to modify value in dictionarygive the name of the dictionary with the key in square brackets and then the new value you want associated with that key for exampleconsider an alien that changes from green to yellow as game progressesalien_ {'color''green'print("the alien is alien_ ['color'"alien_ ['color''yellowprint("the alien is now alien_ ['color'"we first define dictionary for alien_ that contains only the alien' colorthen we change the value associated with the key 'colorto 'yellowthe output shows that the alien has indeed changed from green to yellowthe alien is green the alien is now yellow for more interesting examplelet' track the position of an alien that can move at different speeds we'll store value representing the alien' current speed and then use it to determine how far to the right the alien should movealien_ {'x_position' 'y_position' 'speed''medium'print("original -positionstr(alien_ ['x_position'])move the alien to the right determine how far to move the alien based on its current speed if alien_ ['speed'='slow'x_increment elif alien_ ['speed'='medium'x_increment elsethis must be fast alien x_increment the new position is the old position plus the increment alien_ ['x_position'alien_ ['x_position'x_increment print("new -positionstr(alien_ ['x_position'])we start by defining an alien with an initial position and positionand speed of 'mediumwe've omitted the color and point values for the sake of simplicitybut this example would work the same way if you included those key-value pairs as well we also print the original value of x_position to see how far the alien moves to the right at uan ifelifelse chain determines how far the alien should move to the right and stores this value in the variable x_increment if the alien' speed is 'slow'it moves one unit to the rightif the speed is 'medium'it moves two dictionaries