generated from mwc/lab_iteration
checkpoint 1: no it wasn't difficult, i know how to use for loops checkpoint 2: ranges are super helpful in iteration and can be very useful when you want to repeat stuff or go through data checkpoint 3: yes, i do think i will write docstrings. I've read them in the past and have found them very insightful. they make it easier to know how programs work, similar to comments in functions.
14 lines
198 B
Python
14 lines
198 B
Python
from turtle import *
|
|
|
|
def square(side_length):
|
|
for x in range(4):
|
|
forward(side_length)
|
|
right(90)
|
|
|
|
|
|
sizes = [20, 40, 60, 80, 100]
|
|
for size in sizes:
|
|
square(size)
|
|
input()
|
|
|