Introduction
Functions help you organize your code by giving a name to a set of instructions. This makes your code easier to read and reuse.
When you want to repeat a task multiple times without rewriting code.
When you want to break a big problem into smaller, manageable parts.
When you want to give a clear name to a piece of code to explain what it does.
When you want to get a result from some input values.
When you want to keep your code clean and organized.