# Python Reference Guide

Basic Concepts:

1. Variables and Data Types
   * int, float, str, bool
   * Variables and assignment (=, +=, -=)
2. Control Flow
   * if, else, elif: Conditional statements
   * for, while: Loop constructs
   * break, continue: Loop control
   * try, except, finally, raise: Exception handling
3. Functions and Modules
   * def: Function definition
   * return: Function return values
   * import, from, as: Module importation

Data Structures:

1. Lists
   * Indexing, slicing
   * Methods: append, remove, pop, extend, sort
2. Dictionaries
   * Usage: {key: value} pairs
   * Methods: keys, values, items, get, update
3. Tuples and Sets
   * Tuples: Immutable
   * Sets: add, remove, union, intersection

Advanced Concepts:

1. Object-Oriented Programming
   * class, object
   * **init**, self
   * Inheritance, Encapsulation, Polymorphism
2. Iterators and Generators
   * yield: Generator functions
   * iter, next: Iterators
3. List Comprehensions and Generators
   * Concise creation of lists and generators
4. Decorators and Context Managers
   * @: Decorator syntax
   * with: Context managers
5. Lambda Functions
   * Anonymous functions

Pythonic Concepts:

1. Comprehensions (List, Dictionary, Set)
2. Slicing
3. Unpacking
4. The Zen of Python: import this

Remember: Python is an evolving language. Keep up-to-date with the latest versions and best practices.


---

# 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.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.
