From 99df846f7caa1b6420cb50cd7604fe885bd39ad5 Mon Sep 17 00:00:00 2001 From: jbayati Date: Thu, 25 Sep 2025 09:28:25 -0400 Subject: [PATCH] A function is similar to a variable because both work coherently. Functions can be helpful in breaking down big problems as you can assign them a specific value so you can use the function instead of continous copy and paste. Which helps save time and helps make the code less cluttered. A example is giving the function a specific variable such as (X = Y (line of code)) that you can use in smaller bits of code to help break it down. --- shapes.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/shapes.py b/shapes.py index 826a8b7..d0172cb 100644 --- a/shapes.py +++ b/shapes.py @@ -15,6 +15,14 @@ def triangle(side_length): def rectangle(height, width): - pass + + forward(height) + right(90) + forward(width) + right(90) + forward(height) + right(90) + forward(width) + right(90)