Function

Domain: Programming Fundamentals

🎯 Motivation

When you do the same thing multiple times, wrapping it in a function avoids repetition and makes code readable.

πŸ“‹ Concrete Example

def greet(name): return 'Hello, ' + name. Call it: greet('Alice') returns β€˜Hello, Alice’.

πŸ”— Analogy

A recipe card - you write the steps once, then whenever you want that dish, you just follow the card. You can give it different ingredients (arguments) each time.