generated from mwc/lab_iteration
I have reached checkpoint 1
It was a little difficult at first. The way I tackled it was I thought about what needed to be repeated. I came to the conclusion that the 'side' itself needed to be repeated.
This commit is contained in:
parent
c9a270051b
commit
0edd7574d2
20
square.py
20
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)
|
||||
sides=[1, 2, 3, 4]
|
||||
for sides in sides:
|
||||
forward(side_length)
|
||||
right(90)
|
||||
|
||||
sizes = [20, 40, 60, 80, 100]
|
||||
for size in sizes:
|
||||
square(size)
|
||||
square(50)
|
||||
|
||||
|
||||
|
||||
input()
|
||||
|
||||
|
|
Loading…
Reference in New Issue