This repository contains sample codes, presentation slides, and exercises for the Python 101 workshop. It covers Python fundamentals from basic syntax to advanced topics like async programming and testing.
Online Slides: https://1995parham-teaching.github.io/python101/
python101/
├── src/ # Python code examples
│ ├── 01-basics/ # Variables, flow control, functions
│ ├── 02-oop/ # Object-oriented programming
│ ├── 03-advanced-oop/ # Metaclasses, MRO, descriptors
│ ├── 04-functional/ # Functions, iterators, decorators
│ ├── 05-io-files/ # File I/O, pickling
│ ├── 06-networking/ # Socket programming
│ ├── 07-memory/ # Garbage collection, references
│ ├── 08-async/ # Async/await, asyncio
│ ├── 09-libraries/ # Popular libraries (requests, pathlib)
│ ├── 10-testing/ # pytest, mocking
│ └── 11-typing/ # Type hints, generics, dataclasses
├── slides/ # Marp markdown slides
└── .github/workflows/ # CI/CD workflows
- Basic syntax and data types
- Flow control (if/else, loops)
- Functions and lambda expressions
- Object-oriented programming
- Classes, inheritance, and MRO
Examples: src/01-basics/, src/02-oop/, src/03-advanced-oop/
- File I/O and pathlib
- Working with JSON
- HTTP requests with
requestslibrary - Async programming with
asyncio
Examples: src/05-io-files/, src/08-async/, src/09-libraries/
- Testing with pytest
- Type hints and mypy
- Code quality tools (ruff, black)
- Design patterns
Examples: src/10-testing/, src/11-typing/
- Python 3.10 or higher
- uv (Python package manager)
# Clone the repository
git clone https://github.com/1995parham-teaching/python101.git
cd python101
# Install dependencies (uv handles the virtual environment)
uv sync --all-extrasEach Python file in src/ is self-contained and can be run directly:
uv run python src/01-basics/flow-control.py
uv run python src/04-functional/iterators.py# Run tests (pytest is included in dev dependencies)
uv run pytest src/10-testing/ -v# Install Marp CLI
npm install -g @marp-team/marp-cli
# Build all slides
for file in slides/*.md; do
marp "$file" --html
done- 7th Amirkabir Linux Festival -- 2015
- Diginext Software Engineering Bootcamp -- 2023
- Monday, August 14, 2023 -- 18:00 - 20:30
- Saturday, August 19, 2023 -- 18:00 - 20:30
- Monday, August 21, 2023 -- 18:00 - 20:30
- Saturday, August 26, 2023 -- 18:00 - 20:30
- Monday, August 28, 2023 -- 18:00 - 20:30
- Saturday, September 2, 2023 -- 18:00 - 20:30
Thank you for your interest in contributing to Python 101! This section provides guidelines for contributing to this educational repository.
- Fix bugs or typos in code examples
- Add clearer comments or explanations
- Improve docstrings and documentation
- Add expected output comments
- Create additional exercises
- New code examples demonstrating Python concepts
- Additional slides for topics not covered
- Translations of existing content
- Report bugs in code examples
- Suggest improvements or clarifications
- Request new topics to be covered
# Fork the repository on GitHub, then clone your fork
git clone https://github.com/YOUR_USERNAME/python101.git
cd python101
# Add upstream remote
git remote add upstream https://github.com/1995parham-teaching/python101.git# Install development dependencies (uv handles the virtual environment)
uv sync --all-extrasgit checkout -b feature/your-feature-name- Follow PEP 8 style guidelines
- Use meaningful variable and function names
- Add type hints where appropriate
- Include docstrings for modules, classes, and functions
Each Python file should follow this structure:
"""
Topic: [Topic Name]
Concepts: [comma-separated list of concepts]
Learning objectives:
- [Objective 1]
- [Objective 2]
Author: [Your name] ([your email])
"""
__author__ = "[Your name]"
# ... code ...
# === Expected Output ===
# [Expected output as comments]
# === Exercises ===
# 1. [Exercise 1]
# 2. [Exercise 2]- Use clear, descriptive commit messages
- Start with a verb (Add, Fix, Update, Remove)
- Reference issues when applicable
Add async HTTP example with aiohttp
- Demonstrates concurrent URL fetching
- Includes error handling pattern
- Closes #123
Before submitting, ensure your code works:
# Run the Python file
uv run python src/path/to/your-file.py
# If adding tests, run pytest
uv run pytest src/10-testing/ -v
# Check types (if applicable)
uv run mypy src/path/to/your-file.py- Push your branch to your fork
- Create a Pull Request against the
mainbranch - Provide a clear description of your changes
- Wait for review and address any feedback
Slides are written in Markdown using Marp.
---
marp: true
theme: default
paginate: true
header: "Python 101"
footer: "Topic Name"
---
# Slide Title
Content here...
---
## Next Slide
More content...npm install -g @marp-team/marp-cli
marp slides/your-slide.md --htmlIf you have questions about contributing, please:
- Check existing issues and pull requests
- Open a new issue for discussion
- Ask in the pull request
Thank you for helping improve Python education!
- Dr.Bakhshi (Helped in holding classes)
- Dr.Payberah (Contributed to creating slides)
- S.M.M.Ahmadpanah (Contributed to editing slides)
- E.Jalalpour (Contributed to editing slides)
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
