Skip to content

OOP & Error Handling

This section covers object-oriented programming, exception handling, logging, and working with files.


Topics

Page What You Will Learn
Classes & Objects Create classes, use __init__, attributes, methods
Inheritance & Composition Inheritance, polymorphism, composition, dunder methods
Exceptions & Logging Try/except, custom exceptions, logging configuration
Files & Data Formats Read/write files, work with JSON and CSV

Key Points

  • Use classes to group related data and behavior
  • Prefer composition over deep inheritance chains
  • Never silently ignore exceptions
  • Always use context managers (with) for files

See also