Introduction
Functions help you organize your code by grouping instructions together. You can run the same set of instructions many times without rewriting them.
When you want to repeat a task multiple times in your program.
When you want to break a big problem into smaller, manageable parts.
When you want to reuse code in different places without copying it.
When you want to make your code easier to read and understand.