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]))Define a function with def, give it parameters, and return a result. Calling the function runs its body with the supplied arguments.
def average(values):
return sum(values) / len(values)
print(average([82, 91, 76, 95]))