# ООП - классы и объекты

## Определение класса

Для определения класса используется оператор `class`:

```python
class имя_класса(надкласс1, надкласс2, ...):
    # определения атрибутов и методов класса
```

## Модификаторы доступа

```python
self.name = "Alexey" # Публичный (Public)
self._age = 27 #  Защищенный (Protected)
self.__city = "Moscow" # Приватный (Private)
```

### Публичный / Public

```python
self.name = "Alexey" # Публичный (Public)
```

### Защищенный / Protected

```python
self._age = 27 #  Защищенный (Protected)
```

### Приватный / Private

```python
self.__city = "Moscow" # Приватный (Private)
```

## Наследование

## Видео

[https://www.youtube.com/watch?v=jtIq61A1LLw](https://www.youtube.com/watch?v=jtIq61A1LLw\&feature=youtu.be)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://a1exdi.gitbook.io/pythonbookmanual/klassy-i-obekty.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
