Note 17.5.1.
Some people call parameters the formal parameters and arguments the actual parameters. We will stick to parameters and arguments to avoid confusion about what we mean when we just say “parameters”.
def hop(turtleName): # turtleName is a parameter
...
...
hop(sue) # a procedure call using the sue turtle as the argument
hop
will be executed. Any time we encounter the parameter turtleName
, we will use the argument - sue
in its place. This process of giving the procedure information by specifying arguments is known as passing parameters to the procedure.
hop(buster)
to run hop
and when we do so, turtleName
will mean the turtle named buster
.
hop
procedure. Then, the main part of the program makes two turtles, has them mark their starting location, and then has them each do a hop before doing a forward movement.
def spin(who):
________.left(180)
# Main part of the program
from turtle import *
ray = Turtle()
spin(ray)