Introduction
Scope tells your program where to find variables. It helps keep things organized and avoids confusion.
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 another part of your program.
When you want to reuse variable names in different parts without mixing them up.
When you want to understand why a variable has a certain value at a point in your program.