From 4b66b46496b834bfb8ad392deaf3ac81b34a3b05 Mon Sep 17 00:00:00 2001 From: jwberent Date: Thu, 11 Sep 2025 17:35:56 -0400 Subject: [PATCH] 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. --- square.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/square.py b/square.py index f1fb2a2..088aaca 100644 --- a/square.py +++ b/square.py @@ -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()