Introduction
Functions help you keep your code neat and easy to use again without rewriting it.
When you need to repeat the same steps multiple times in a script.
When you want to make your script easier to read and understand.
When you want to fix or update a task in one place instead of many.
When you want to share a piece of code with others or use it in different scripts.