This was a tough code for me

I attempted to add a for loop to avoid writing forward and right more than once
in the end, the code didn't work but I couldnt figure it out

Checkpoint #1:
Yes, it was. I did not figure it out. Im sure its an easy fix, but I couldnt do it :'(
This commit is contained in:
mbhatti4
2025-09-15 22:06:33 -04:00
parent bd04e64053
commit 6419e4e53e

View File

@@ -1,17 +1,16 @@
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]
def square(side_length):
nums = [20,40,60,80,100]
for side_length in nums:
forward(side_length)
right(90)
sizes = [20, 40, 60, 80, 100]
for size in sizes:
square(size)
input()
forward(10)
right(90)
input()