From 63bb343df9c44d748fe3e646510bf2fca555e8d4 Mon Sep 17 00:00:00 2001 From: mollychi Date: Sun, 14 Sep 2025 21:06:45 -0400 Subject: [PATCH] I removed the extra forwards and rights, created a new temporarily assigned variable called sides and juts put numbers 1 through 4 in it as the numbers dont matter since i have assigned values for my forward and right already. At first I was a little confused on if i had to edit the existing for loop and if so how, so i took a second to run the existing code to see that i dont need to change the existing for loop as that just makes the square run 4 times, i realized i need to make a new for loop inside of square. That was really my only struggle. --- square.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/square.py b/square.py index f1fb2a2..646b099 100644 --- a/square.py +++ b/square.py @@ -1,14 +1,12 @@ from turtle import * +sides = [1,2,3,4] def square(side_length): - forward(side_length) - right(90) - forward(side_length) - right(90) - forward(side_length) - right(90) - forward(side_length) - right(90) + for side in sides: + forward(20) + right(90) + + sizes = [20, 40, 60, 80, 100] for size in sizes: