From faadb0fd430d901b7997e634cc8d082962137237 Mon Sep 17 00:00:00 2001 From: Hope Date: Sat, 3 May 2025 14:06:28 -0400 Subject: [PATCH] I added a for loop to replace the repetition of the commands to draw each side. No, I just found the code that was repeated and put it in the loop. I understand how to define what is in the loop and how to iterate through the steps. At this point I don't have any questions, but I'm sure as soon as we get more complex I'll have some. Yes, because I like documentation and I have a terrible memory. --- square.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/square.py b/square.py index f1fb2a2..2385113 100644 --- a/square.py +++ b/square.py @@ -1,14 +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) + for i in range(4): + forward(side_length) + right(90) + sizes = [20, 40, 60, 80, 100] for size in sizes: