generated from mwc/lab_iteration
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:
21
square.py
21
square.py
@@ -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()
|
||||
Reference in New Issue
Block a user