programtriangle py import math from graphics import def square( )return def distance( )dist math sqrt(square( getx( getx()square( gety( gety())return dist def main()win graphwin("draw triangle"win setcoords( message text(point( )"click on three points"message draw(winget and draw three vertices of triangle win getmouse( draw(winp win getmouse( draw(winp win getmouse( draw(winuse polygon object to draw the triangle triangle polygon( , , triangle setfill("peachpuff"triangle setoutline("cyan"triangle draw(wincalculate the perimeter of the triangle perim distance( , distance( , distance( , message settext("the perimeter is{ : }format(perim)wait for another click to exit win getmouse(win close(main(