# Cheat Sheet

```
// +----------------------------------+----------------------------------+
| Basic Concepts & Data Structures | Advanced Concepts & Pythonic    |
|                                  | Concepts                        |
+----------------------------------+----------------------------------+
| **Variables and Data Types**     | **Object-Oriented Programming** |
| - int, float, str, bool          | - class, object                 |
| - Variables and assignment       | - init, self                    |
|   (=, +=, -=)                    | - Inheritance, Encapsulation,   |
|                                  |   Polymorphism                  |
+----------------------------------+----------------------------------+
| **Control Flow**                 | **Iterators and Generators**    |
| - if, else, elif                 | - yield: Generator functions   |
| - for, while                     | - iter, next: Iterators         |
| - break, continue                | **List Comprehensions and       |
| - try, except, finally, raise    |   Generators**                  |
|                                  | - Concise creation of lists and |
|                                  |   generators                    |
+----------------------------------+----------------------------------+
| **Functions and Modules**        | **Decorators and Context        |
| - def: Function definition       |   Managers**                    |
| - return: Function return values | - @: Decorator syntax           |
| - import, from, as               | - with: Context managers        |
+----------------------------------+----------------------------------+
| **Lists**                        | **Lambda Functions**            |
| - Indexing, slicing              | - Anonymous functions           |
| - Methods: append, remove, pop,  |                                 |
|   extend, sort                   | **Comprehensions (List,         |
+----------------------------------+ |   Dictionary, Set)**           |
| **Dictionaries**                 | - Slicing                       |
| - Usage: {key: value} pairs      | - Unpacking                     |
| - Methods: keys, values, items,  | - The Zen of Python: import this|
|   get, update                    |                                 |
+----------------------------------+----------------------------------+
| **Tuples and Sets**              |                                 |
| - Tuples: Immutable              |                                 |
| - Sets: add, remove, union,      |                                 |
|   intersection                   |                                 |
+----------------------------------+----------------------------------+
```


---

# 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://itrp19-notes.gitbook.io/notes/reference/python3/python-reference-guide/cheat-sheet.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.
