Lesson 1 of 9 · 7 min
Functions, parameters and return values
A function is a reusable, named block of code. It can take parameters (inputs) and produce a return value (output). Functions support decomposition — breaking a big problem into small, testable parts — keeping code organised and reusable.
def area(w, h): return w*h
Inputs → function → output
Let’s try it! ✍️
Question 1 of