Lesson 11 of 12

Functions 🔧

🎯 Grades 6–8 ⏱ ~25 minutes 💚 Intermediate

What You'll Learn

  • Define and call your own functions with def
  • Use parameters to pass data into functions
  • Return values from functions with return
Quick Check

1. What keyword starts a function definition?

Afunction
Bdefine
Cdef

2. What does return do inside a function?

APrints the result to the screen
BSends a value back to the caller
CStops the entire program

3. What are the variables in the parentheses of a function definition called?

AReturns
BParameters
CCalls

4. How do you call a function named calculate with arguments 10 and 5?

Adef calculate(10, 5)
Bcalculate(10, 5)
Ccall calculate 10 5