from graphics import def main()introduction print("this program plots the growth of -year investment "get principal and interest rate principal eval(input("enter the initial principal")apr eval(input("enter the annualized interest rate")create graphics window with labels on left edge win graphwin("investment growth chart" win setbackground("white"win setcoords(- ,- text(point(- ) 'draw(wintext(point(- ) 'draw(wintext(point(- ) 'draw(wintext(point(- ) 'draw(wintext(point(- )' 'draw(windraw bar for initial principal bar rectangle(point( )point( principal)bar setfill("green"bar setwidth( bar draw(windraw bar for each subsequent year for year in range( )principal principal ( aprbar rectangle(point(year )point(year+ principal)bar setfill("green"bar setwidth( bar draw(wininput("press to quit "win close(main(notice how the cumbersome coordinate calculations have been eliminated this version also makes it easy to change the size of the graphwin changing the window size to produces largerbut correctly drawn bar graph in the original programall of the calculations would have