From 2e94868b5a6abbfc795511492d4866713376b6ea Mon Sep 17 00:00:00 2001 From: Rebecca Hankey Date: Wed, 11 Sep 2024 22:27:33 -0400 Subject: [PATCH] I changed the definition of square to simplify. Now it reads using the for_in command and only needs to be prompted to move forward and turn once. I am finding that the directions you have written are clear and very easy to follow. Then when it comes time to work through a checkpoint, I am struggling to apply the informaiton that was given to a task. It is like I know what it means when I read it, but then I get lost and cannot figure out how this information is applicable. For this check point I worked ahead a little and saw that there was a range command. I thought it must be applicable, but was not sure how. I talked through it with a couple people and then looked up similar simplification examples to see how range was used. Then there was some trial and error to get the details right. --- square.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/square.py b/square.py index c5f1cac..582bf49 100644 --- a/square.py +++ b/square.py @@ -1,16 +1,14 @@ 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 _ in range(4): + forward(side_length) + right(90) sizes = [20, 40, 60, 80, 100] for size in sizes: - square(size) + square(20) + penup() + forward(40) + pendown()