I changed the square function to using a for-loop instead of having to write the turtle function multiple times.

Checkpoint 1:
- It wasn't that difficult for me because I have a little prior coding experience.  I tried multiple different things and realized I could make the numbers in the list the same as the parameter so each side of the square would be that number.
This commit is contained in:
jwberent
2025-09-11 17:35:56 -04:00
parent 438af8230a
commit 4b66b46496

View File

@@ -1,17 +1,10 @@
from turtle import *
def square(side_length):
forward(side_length)
right(90)
forward(side_length)
right(90)
forward(side_length)
right(90)
forward(side_length)
right(90)
sizes = [20, 40, 60, 80, 100]
for size in sizes:
square(size)
sizes = [side_length, side_length, side_length, side_length]
for side in sizes:
forward(side)
right(90)
square(100)
input()