Python Functions

Define a function with def, give it parameters, and return a result. Calling the function runs its body with the supplied arguments.

Python
def average(values):
    return sum(values) / len(values)

print(average([82, 91, 76, 95]))
Read the full lesson