Lesson 28 of 51 · Loops & Functions
Defining Functions
Functions let you reuse code with a name.
Python
from turtle import *
bgcolor("black")
color("gold")
pensize(3)
speed(0)
def square():
for i in range(4):
forward(80)
right(90)
square()
done()Output

1
Defining a Function
def name(): then indent the body. Call it with name().