generated from mwc/lab_iteration
- No, the wording of the lab was a little confusing because it says to use list iteration but you don't actually need a list for it. Also, the function still "calls" forward and right four times; we only wrote it once.
13 lines
193 B
Python
13 lines
193 B
Python
from turtle import *
|
|
|
|
def square(side_length):
|
|
for _ in range(4):
|
|
forward(side_length)
|
|
right(90)
|
|
|
|
sizes = [20, 40, 60, 80, 100]
|
|
for size in sizes:
|
|
square(size)
|
|
input()
|
|
|