Question: 2. Use the turtle graphics library to create a Colorful Triangles Python program that uses nested loops to draw (i.e. not stamp) 3 rows of


2. Use the turtle graphics library to create a Colorful Triangles Python program that uses nested loops to draw (i.e. not stamp) 3 rows of different colored equilateral triangles in each row. (Note: Equilateral triangles have three equal sides with all angles at 60 degrees.) Rows can have any number of triangles in the range of 3 to 12. Prompt, read, and validate user input number of columns and colors. Create a colorful triangles drawing when input is in the valid ranges. Include a multi-line program comment header that includes your name, date, class, and short problem description Prompt, read, and validate a number of columns in the range of 3 to 12. Only create a drawing when column input is in this range; display an error message otherwise. . RESTART: F:\COD\CurrCourses CIS2531Python Labs\Lab4 How many columns to display (3 to 12)? 1 ERROR! Number of columns must be in range of 3 to 12! >>> F== RESTART: F:\COD\CurrCourses\CIS2531Python\Labs\Lab4 How many columns to display (3 to 12)? 13 ERROR! Number of columns must be in range of 3 to 12! | === Prompt, read, and validate a series of three different colors. NOTE: You do not need to validate the colors themselves, only that they are different. Only create a drawing when colors are different for each row; display an error message otherwise. RESTART: F:\COD\CurrCourses\CIS2531Pyt How many columns to display (3 to 12)? 5 What is the first row color? red What is the second row color? white What is the third row color? red ERROR! All colors must be different! >>> | Use the valid number of columns and colors to create a pattern centered in the fixed displayed window. The size of the triangles should be uniform and change appropriately with the number of triangles drawn. Some examples: Colorful Triangles === RESTART: F:\COD\CurrCourses CIS2531 Pyt How many columns to display (3 to 12)? 3 What is the first row color? red What is the second row color? yellow What is the third row color? green | Colorful Triangles === RESTART: F:\COD\CurrCourses\CIS2531 Pytho How many columns to display (3 to 12)? 5 What is the first row color? red What is the second row color? white What is the third row color? blue >>] Colorful Triangles === RESTART: F:\COD\CurrCourses\CIS2531Python How many columns to display (3 to 12)? 12 What is the first row color? salmon2 What is the second row color? turquoise2 What is the third row color? spring green
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
