house setfill(colormsg settext('click to choose door color 'color getchoice(colorpairs'white'windoor setfill(colorin the original version with the long if-elif statementsthe interactive portion only included portions for the user to set the color of two shapes in the picture (or you would have been reading code foreverlooking now at the similarity of the code for the two partswe can imagine another loopthat would easily allow for many more parts to be colored interactively there are still several differences to resolve first the message msg is created the first timeand only the text is set the next time that is easy to make consistent by splitting the first part into an initialization and separate call to settext like in the second partmsg text(point(win getwidth()/ ),''msg draw(winmsg settext('click to choose house color 'then look to see the differences between the code for the two choices the shape object to be colored and the name used to describe the shape changetwo changes in each part again tuples can store the changes of the form (shapedescriptionthis is another place appropriate for loop driven by tuples the (shapedescriptiontuples should be explicitly written into list that can be called shapepairs we could easily extend the list shapepairs to allow more graphics objects to be colored in the code belowthe roof is added the new interactive code can start withshapepairs [(house'house')(door'door')(roof'roof')msg text(point(win getwidth()/ ),''msg draw(winfor (shapedescriptionin shapepairsprompt 'click to choose description color can you finish the body of the looplook at the original version of the interactive code when you are done thinking about itgo on to my solution the entire code is in example program choosebutton pyand also below the changes from choosebutton py are in three blockseach labeled #new in the code the new parts are the getchoice function and the two new sections of main with the loops'''make choice of colors via mouse clicks in rectangles -demonstate loops using lists of tuples of data ''from graphics import def isbetween(xend end )'''return true if is between the ends or equal to either the ends do not need to be in increasing order ''return end < <end or end < <end def isinside(pointrect)'''return true if the point is inside the rectangle rect ''pt rect getp (pt rect getp (return isbetween(point getx()pt getx()pt getx()and isbetween(point gety()pt gety()pt gety() loops and tuples