DEMO 1: A function is a defined block of code that has a specific task.

A function will not run until it is called. You can call a function anywhere in your code after you define it.

  • Click Run to see a the parts of a function.
  • Click the words Next Step on the stage to see what each line does.
  • Click Submit and Next to answer the questions about functions in the next activity.

def tour(): sprite = codesters.Sprite("person1", -150, -60) sprite.say("I can take you on a tour") sprite.move_forward(550) tour()