Lazo Lab Sign up

Python Fundamentals / Functions and errors

Lesson 30 of 38

Return values

return sends a value back to whoever called the function. A function without return gives back None.

Key points

  • return ends the function
  • Store the result in a variable
  • No return means None
def area(w, h):
    return w * h

print(area(3, 4))  # 12
Watch a video on thisOpens YouTube search results for “Return values” in a new tab

Quiz · +10 XP

What does a function return if it has no return statement?

Log in to save progress and earn XP.