A collection of Python tutorials, examples, exercises, and projects covering Python programming fundamentals, data structures, functions, object-oriented programming, file handling, error handling, and practical application development.
This repository provides practical, beginner-friendly tutorials for learning Python programming.
It includes reusable code examples, exercises, and step-by-step demonstrations of important Python concepts. The repository is designed for students, analysts, developers, and data professionals who want to build a strong foundation in Python.
Python-Tutorials/
│
├── tutorials/
│ └── dotenv-tutorial/
│ ├── .env.example
│ ├── dotenv_example.py
│ └── README.md
│
├── .gitignore
├── .python-version
├── pyproject.toml
├── uv.lock
└── README.md
The repository structure may evolve as additional tutorials and projects are added.
To run the examples in this repository, install:
- Python 3.12 or later
- Git
- Visual Studio Code or another Python-compatible editor
uvfor Python project and dependency management
Clone the repository:
git clone https://github.com/theanalyticschool/Python-Tutorials.gitNavigate to the project directory:
cd Python-TutorialsCreate a virtual environment using uv:
uv venv --python 3.12Activate the virtual environment in PowerShell:
.venv\Scripts\Activate.ps1Run a Python file:
python filename.pyYou can also run a Python file directly with uv:
uv run python filename.pydef calculate_average(numbers: list[float]) -> float:
"""Return the average of a list of numbers."""
if not numbers:
raise ValueError("The numbers list cannot be empty.")
return sum(numbers) / len(numbers)
values = [10, 20, 30, 40, 50]
average = calculate_average(values)
print(f"Average: {average}")Contributions, corrections, and suggestions are welcome.
To contribute:
- Fork the repository.
- Create a new branch.
- Make your changes.
- Commit your changes.
- Push the branch to your fork.
- Submit a pull request.
The examples and projects in this repository are intended for educational purposes. Code should be reviewed, tested, and adapted before being used in production applications.
Analytics School
GitHub: theanalyticschool