Introduction
Scope tells us where a variable can be used in the code. It helps keep things organized and avoids mistakes.
When you want to use a variable only inside a small part of your program.
When you want to avoid changing a variable by mistake in other parts of the code.
When you want to reuse the same variable name in different parts without conflict.
When you want to understand where a variable is created and where it stops existing.