Defining Functions

Bundle steps into reusable units.

Lesson 1

Concept

Functions take inputs (parameters), do work, and return outputs. Keep them small and single-purpose. Name clearly to reveal intent.

Try it

Write a function that takes a list of numbers and returns the average.