> For the complete documentation index, see [llms.txt](https://kallyasmedia.gitbook.io/cit-python-cohort-three/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kallyasmedia.gitbook.io/cit-python-cohort-three/week3/oop.md).

# Oop

Intro to object-oriented programming concepts in Python.

OOP models real‑world things as objects with data (attributes) and behavior (methods).

## Core Ideas

* **Class**: blueprint for objects
* **Object**: instance of a class
* **Encapsulation**: keep data and behavior together
* **Inheritance**: reuse behavior from a base class
* **Polymorphism**: same interface, different implementations
* **Abstraction**: hide complex details behind a simple interface

## Quick Example

```python
class Dog:
    def __init__(self, name):
        self.name = name

    def speak(self):
        return f"{self.name} says woof"

pet = Dog("Rex")
print(pet.speak())
```

## Topics

* [Classes](/cit-python-cohort-three/week3/classes.md)
* [Inheritance](/cit-python-cohort-three/week3/inheritance.md)
* [Polymorphism](/cit-python-cohort-three/week3/polymorphism.md)
* [Encapsulation](/cit-python-cohort-three/week3/encapsulation.md)
* [Abstraction](/cit-python-cohort-three/week3/abstraction.md)

[Previous](/cit-python-cohort-three/week3/python_exceptions.md)
