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.
This commit is contained in:
jwberent
2025-09-05 14:57:41 -04:00
parent f0f2557b00
commit 8dfa384f43

View File

@@ -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)