for Loop in Python
for walks each item in an iterable, one by one. Shape: for name in names: print(name). You can loop a list, a string, a tuple, dict keys, or range. range(5) is 0..4. range(1, 6) is 1..5. The stop is exclusive — that off-by-one mistake prints 1..6 when you wanted 1..5.
enumerate(names) gives index and value together: for i, n in enumerate(names):. Dry-run: for i in range(1, 4): print(i) → 1 then 2 then 3. Say the stop is exclusive before you write the code.
for Loop in Python — output — 1 2 3 4 5 each on a new line. range(1, 6) stops before 6.
names = [Asha, Ravi, Neha]
│
▼
for x in names:
Asha → Ravi → Neharange stop is exclusive — say it clearly.