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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started