Functions
Functions: Reusable Blocks of Code 🦸
You've already been using functions this whole time — print(), input(), len(), int() are all functions built into Python. Now you'll learn to write your own.
A function is a named, reusable block of code. You define it once with def, then call it (run it) as many times as you want, optionally handing it information (parameters) and getting information back (return values).
This unit covers everything you need: parameters, return values, default values, returning more than one thing at once, functions calling other functions, and one of the most common beginner mix-ups — the difference between print and return.