From 8dfa384f434e600dbe82d0d7faf35de848b3ac3c Mon Sep 17 00:00:00 2001 From: jwberent Date: Fri, 5 Sep 2025 14:57:41 -0400 Subject: [PATCH] I already submitted the changes I made in checkpoint 1 so please let me know if I need to rewrite the changes I made in checkpoint 1 since I am saving it again. I will only be talking about checkpoint 2 now. I removed the pass in the triangle and rectangle functions and added the necessary code by using right and forward in the turtle library to make triangles and rectangles appear. Checkpoint 2: -A function is like a variable in that it allows you to save code that will be ran everytime you call it. -Functions can break down big problems by allowing you to run the same thing over and over by just calling it. An example would be coding a house. This chould be accomplished by making a door function, triangle function, and rectangle function which could be used for the walls and smaller rectangles that could be used for the windows. --- shapes.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/shapes.py b/shapes.py index 731ec39..77e0fe1 100644 --- a/shapes.py +++ b/shapes.py @@ -5,7 +5,20 @@ 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)