← Python Roadmap Home

11. Errors & Exception Handling

Common errors, try/except, defensive mindset

Goals:

1. Errors normal hain

SyntaxError — typing/structure
NameError — variable define nahi
TypeError — galat type operation
ValueError — type theek, value galat (jaise int("abc"))
IndexError — list index bahar
Live practice 1 — try/except ValueError
except block chalna chahiye.

Live practice 2 — ZeroDivision
Safe divide.