Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions

Question

Discuss all branches of science

Answered: 1 week ago

Question

Which team solution is more likely to be pursued and why?

Answered: 1 week ago

Question

4. I can tell when team members dont mean what they say.

Answered: 1 week ago