A function is a named block of code that you define once and reuse whenever you need it. In Python, you create one with the def statement: you give the function a name, list any parameters in parentheses, and indent the body beneath the colon. When the function finishes, a return statement can hand a value back to the code that called it — and if you omit return, Python quietly returns None. Calling the function by name, with parentheses and any required arguments, is what actually runs that code.
This matters because almost everything that follows in the course is built on functions. Parameter styles, scope rules, recursion, and the functional patterns later in this module all assume you are comfortable with the basic def/return/call cycle. Good habits start here too: descriptive names in lowercase_with_underscores, and a docstring — a triple-quoted string on the first line of the body — that explains what the function does, what it expects, and what it gives back.
As you watch, keep three questions in mind. First, what is the difference between a function that returns a value and one that only prints something — can you use the result in an expression afterward? Second, where does execution go when a return runs, and what happens to any code after it? Third, what does the function need from the caller, and what does the caller get back? Try pausing and predicting the output before the narrator reveals it.
A comprehensive single-video walkthrough of Python functions, covering the def statement and its syntax, the pass placeholder for empty function bodies, arguments, the None value, and variable scope. The title also highlights the frequently confused distinction between return and print, which is one of the most common stumbling blocks for beginners. At roughly sixteen minutes it is the longest of the three and serves as the main overview for this topic.
It touches nearly every subtopic here — defining with def, calling with arguments, and returning values — in one continuous explanation, and its direct treatment of return versus print addresses the error students most often make when writing their first functions.
Bro Code's concise introduction defines a function as a block of code that executes only when it is called, then demonstrates writing one with def and invoking it by name. Expect short, typed-along examples that show parameters being passed in and the function body running on demand. The pacing is quick and the examples are deliberately simple.
It is a clean, beginner-friendly treatment of the def statement and of calling a function, from a channel widely used for its clear, no-filler coding demonstrations — a good first watch or a quick review before the longer video.
A short, focused lesson on the return statement: how a function sends a value or object back to the caller so the result can be stored in a variable or used in a larger expression. In about three and a half minutes it isolates the single concept rather than mixing it with other function topics.
Because return is the subtopic students most often misunderstand, a dedicated short video is valuable; it reinforces that a returned value is reusable data, not screen output, which is the key idea behind building functions that compose.
Together these videos build the foundation for MO1: the BitBoss overview and the Bro Code introduction demonstrate constructing functions with def and passing arguments, while the dedicated return video reinforces writing explicit return statements that produce usable results. The scope discussion in the BitBoss video previews the LEGB reasoning developed in MO2, and the habit of writing small, well-named, documented functions established here is what later outcomes depend on — recursion in MO3 requires a function that returns a value from both its base and recursive cases, and the comprehension and lambda comparisons in MO4 and MO5 only make sense once you can read a standard def-based function fluently. Supplement the videos with the course material on docstrings, since documentation is part of MO1 but receives limited attention in these clips.
These videos were chosen from YouTube on October 2, 2026. Each has captions; the player turns them on. Videos on YouTube can be changed or removed — if one no longer plays, tell your instructor. If a player does not appear, use its Watch on YouTube link.