here is an example of an interactive program that allows the user to draw triangle by clicking on three points in graphics window this example is completely graphicalmaking use of text objects as prompts no interaction with python text window is required if you are programming in microsoft windows environmentyou can name this program using pyw extension then when the program is runit will not even display the python shell window triangle pyw from graphics import 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(winwait for another click to exit message settext("click anywhere to quit "win getmouse(main(the three-click triangle illustrates couple new features of the graphics module there is no triangle classhowever there is general class polygon that can be used for any multi-sidedclosed shape the constructor for polygon accepts any number of points and creates polygon by using line segments to connect the points in the order given and to connect the last point back to the first triangle is just three-sided polygon once we have three points and creating the triangle is snap triangle polygon(