Local Variable

Domain: Programming Fundamentals

🎯 Motivation

Variables created inside a function only exist while that function runs - they’re local.

📋 Concrete Example

def greet(): msg = 'Hi' - msg exists only inside greet(). After greet() finishes, msg is gone.

🔗 Analogy

A whiteboard in a meeting room - you write on it during the meeting, but when you leave, the next meeting erases it.