Files
lab_iteration/square.py
ilmabura 0df5838eb4 i changed the square.py file to use 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.
2025-09-07 22:35:34 -04:00

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()