From 45ef6f4c9f145f390ec731da10a250ce3c1ebeef Mon Sep 17 00:00:00 2001 From: cdonahue Date: Thu, 25 Sep 2025 09:28:17 -0400 Subject: [PATCH] A function is like a vraiable in the fact of that they both work coherently Fucntions can be helpful in breaking down big prolblems as you can assign them a specific value, which helps save time and helps make the code less clunky and long. A variable is used for a short hand of a value for example a variable could be X and X could be defined as something like (hello) which would then shape into a bigger code if ever need be repeated. --- shapes.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/shapes.py b/shapes.py index 731ec39..fe00a07 100644 --- a/shapes.py +++ b/shapes.py @@ -5,7 +5,25 @@ 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(height) + right(90) + forward(width) + right(90) + forward(height) + right(90) + forward(width) + right(90) + + + + +