Lesson 29 of 51 · Loops & Functions
Function Parameters
Pass values to functions to make them flexible.
Python
from turtle import *
bgcolor("black")
color("violet")
pensize(3)
speed(0)
def polygon(sides, length):
angle = 360 / sides
for i in range(sides):
forward(length)
right(angle)
polygon(5, 100)
done() Output

1
Parameters
def square(size): — size becomes a variable inside the function.