Key Concepts

Review core concepts you need to learn to master this subject

Returning Multiple Values

def square_point(x, y, z): x_squared = x * x y_squared = y * y z_squared = z * z # Return all three values: return x_squared, y_squared, z_squared three_squared, four_squared, five_squared = square_point(3, 4, 5)

Python functions are able to return multiple values using one return statement. All values that should be returned are listed after the return keyword and are separated by commas.

In the example, the function square_point() returns x_squared, y_squared, and z_squared.

Introduction to Functions
Lesson 1 of 1

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo