Modify Polygon Program Create Triangle Replace Square Function Call Random Pattern Program Q37078858

Modify the polygon program to create a triangle. Replace thesquare function call in the random pattern program with thetriangles function calls.

def drawPolygon(turtle, vertices): Draws a polygon from a list of vertices The list has the form [(xl, yl), , (xn. yn)1. tur

from turtlegraphics import Turtle random def drawsquare(turtle, X, y, length): Draws a square with the upper-left corner (x,y

def drawPolygon(turtle, vertices): “Draws a polygon from a list of vertices The list has the form [(xl, yl), , (xn. yn)1. turtle.up() (x, y)-verticest-1 turtle.move(x, y) turtle. down() for (x, y) in vertices turtle.move(x,

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.