Introduction
As your programs grow, you'll start noticing the same logic showing up in more than one place. Copy-pasting that logic works for a while, but it quickly becomes hard to update, easy to break, and painful to read. Functions solve that problem by giving a name to a block of code and letting you reuse it anywhere.
In this module, you learn how to define functions, pass data to them with parameters, get results back with return values, and understand how variable scope keeps your code from stepping on itself. You also learn how to split code across multiple files and import your own modules. Finally, you'll build a calculator that organizes its operations into functions.
Note
We recognize that different people like to learn in different ways. You can choose to complete this module in video-based format or you can read the content as text and images. The text contains greater detail than the videos, so in some cases you might want to refer to it as supplemental material to the video presentation.