A function is a named trick Peter can do. This one adds two numbers and gives them back.
def add(a, b):
return a + b
print(add(2, 3))
Run ▶ Next Lesson →
def starts a function. return hands back the answer.
def
return