From 6511af08498ff645043f0f5cd8ad941ceb85d431 Mon Sep 17 00:00:00 2001 From: tgaeta Date: Mon, 15 Sep 2025 13:05:50 -0400 Subject: [PATCH] Created functions to draw a triangle and a rect. - It's like a variable in that you reference it by name - Functions break routines up into subprocesses; think recursion. Quick sort is a perfect example of this. --- shapes.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/shapes.py b/shapes.py index 731ec39..d6eadaf 100644 --- a/shapes.py +++ b/shapes.py @@ -5,7 +5,19 @@ from turtle import * def triangle(side_length): - pass + forward(side_length) + right(120) + forward(side_length) + right(120) + forward(side_length) + right(120) def rectangle(height, width): - pass + forward(width) + right(90) + forward(height) + right(90) + forward(width) + right(90) + forward(height) + right(90)