Imagine you love cooking and have a collection of recipes. Each recipe is a set of instructions to make a specific dish, like pancakes or spaghetti. Instead of figuring out how to make pancakes from scratch every time, you follow the same recipe. This saves time and effort. You can use the recipe whenever you want pancakes, and even share it with friends.
In computing, a function is like a recipe. It is a reusable set of instructions that performs a specific task. You can 'call' the function whenever you need it, just like using a recipe to cook a dish. This helps programmers avoid repeating the same code and makes programs easier to understand and maintain.