but--not to put too fine point on it--this function is just too long one way to make the program more readable is to move some of the details into separate function for examplethere are eight lines in the middle that simply create the window where the chart will be drawn we could put these steps into value returning function def createlabeledwindow()returns graphwin with title and labels drawn window graphwin("investment growth chart" window setbackground("white"window setcoords(- ,- text(point(- ) 'draw(windowtext(point(- ) 'draw(windowtext(point(- ) 'draw(windowtext(point(- ) 'draw(windowtext(point(- )' 'draw(windowreturn window as its name impliesthis function takes care of all the nitty-gritty details of drawing the initial window it is self-contained entity that performs this one well-defined task using our new functionthe main algorithm seems much simpler def main()print("this program plots the growth of -year investment "principal input("enter the initial principal"apr input("enter the annualized interest rate"win createlabeledwindow(drawbar(win principalfor year in range( )principal principal ( aprdrawbar(winyearprincipalinput("press to quit "win close(notice that have removed the commentsthe intent of the algorithm is now clear with suitably named functionsthe code has become nearly self-documenting here is the final version of our future value programfutval_graph py from graphics import