Question: In this problem, you should write a complete python function named draw_the_triangles. This function should have three parameters. The first will be a graphics /

In this problem, you should write a complete python function named draw_the_triangles. This function should have three parameters. The first will be a graphics / gui object that already has been set up to be a 400 x 400 canvas. The second will be a list. The list will be formatted so that its length will be multiple of two, containing 0 or more, x, and y coordinate pairs. The function should draw a 100x100 right-triangle at each of the locations. The 90 degree corner of the triangle should be aligned with the coordinate. The third parameter will be a string, representing the color to draw the triangles. It should also make the background of the canvas green.

For example, say that the second parameter is [100, 100, 400, 300] and the third parameter is 'orange'. This means that the function should draw a triangle at (100, 100) and another at (400, 300).

Keep in mind that the list could be any length that is a multiple of two.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!