Wrote function triangle so that it draws a triangle with a side_length as the argument, and the function rectangle so that it draws a rectangle with a height and width as the two arguments.

This commit is contained in:
kated
2026-02-09 11:12:04 -05:00
parent 4344dea056
commit d591ca6259

View File

@@ -5,7 +5,19 @@
from turtle import * from turtle import *
def triangle(side_length): def triangle(side_length):
pass forward(side_length)
right(120)
forward(side_length)
right(120)
forward(side_length)
right(120)
def rectangle(height, width): def rectangle(height, width):
pass forward(width)
right(90)
forward(height)
right(90)
forward(width)
right(90)
forward(height)
right(90)