🎉 October Learning Month — learn a new software term every day!
An interactive flashcard trainer for software engineering terms.

Function

In plain terms

A reusable block of code that performs a task.

Going deeper

A function encapsulates logic that can take inputs (parameters) and return an output, called wherever needed to avoid repetition. It packages reusable behavior.

Under the hood

Pure functions avoid side effects; first-class functions can be passed around as values.

Examples

def add(a,b), reusable logic, parameters, return values, methods.

Think of it like...

Like a kitchen appliance, give it ingredients (inputs) and it produces a result.

Feedback & Bug Report