What are 'Functions' in programming?

Asked by stem_mind · 2 weeks ago

1 Answer

22
amorebise · 2 weeks ago Top Answer

A function is like a 'recipe' you've saved. Instead of writing the instructions to make Chin-Chin every time, you just say 'Run the Chin-Chin recipe'.

It's a block of code designed to do one specific task. You give it some input, it does some work, and it gives you a result. It keeps your code organized and clean.

Think of it as a specialized worker in a factory. One worker only packs boxes. One worker only seals them. In code, one function might only calculate taxes.

Log in to add a comment.