Skip to content

blaxkmiradev/roadmap-python-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 

Repository files navigation

🐍 Python Learning Roadmap

Python Version License Contributions

A comprehensive, structured roadmap for learning Python from zero to hero 🎯


πŸ“‹ Table of Contents

  1. Roadmap Overview Diagram
  2. What is Python?
  3. Setting Up Your Environment
  4. Python Fundamentals
  5. Intermediate Python
  6. Advanced Python
  7. Python for Data Science
  8. Python for Web Development
  9. Python for Automation & Scripting
  10. Career Paths
  11. Practice Resources
  12. Project Ideas

πŸ—ΊοΈ Roadmap Overview Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                    PYTHON LEARNING ROADMAP                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   BASICS    │────▢│ INTERMEDIATE│────▢│   ADVANCED  │────▢│  SPECIALIZE β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚                   β”‚                   β”‚                   β”‚
    β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”
    β”‚           β”‚       β”‚           β”‚       β”‚           β”‚       β”‚           β”‚
β”Œβ”€β”€β”€β”΄β”€β”€β”€β”   β”Œβ”€β”€β”€β”΄β”€β”€β”€β” β”Œβ”€β”€β”€β”΄β”€β”€β”€β”   β”Œβ”€β”€β”€β”΄β”€β”€β”€β” β”Œβ”€β”€β”€β”΄β”€β”€β”€β”   β”Œβ”€β”€β”€β”΄β”€β”€β”€β” β”Œβ”€β”€β”€β”΄β”€β”€β”€β”
β”‚Syntax β”‚   β”‚  OOP  β”‚β”‚  Web  β”‚   β”‚ Async β”‚β”‚  ML   β”‚   β”‚  DevOpsβ”‚β”‚ Careerβ”‚
β”‚ Vars  β”‚   β”‚  DB   β”‚β”‚  API  β”‚   β”‚Thread β”‚β”‚  AI   β”‚   β”‚  Cloudβ”‚β”‚       β”‚
β”‚ Types β”‚   β”‚  API  β”‚β”‚  ORM  β”‚   β”‚Testingβ”‚β”‚  DS   β”‚   β”‚       β”‚β”‚       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”˜


    ╔═══════════════════════════════════════════════════════════════════════════════════════╗
    β•‘                           LEARNING PHASES (Detailed)                                   β•‘
    ╠═══════════════════════════════════════════════════════════════════════════════════════╣
    β•‘                                                                                        β•‘
    β•‘  PHASE 1: FUNDAMENTALS (Weeks 1-4)                                                     β•‘
    β•‘  β”œβ”€β”€ Hello World & Print Statements                                                    β•‘
    β•‘  β”œβ”€β”€ Variables & Data Types (int, float, str, bool, None)                            β•‘
    β•‘  β”œβ”€β”€ Operators (arithmetic, comparison, logical)                                      β•‘
    β•‘  β”œβ”€β”€ Strings & String Formatting                                                      β•‘
    β•‘  β”œβ”€β”€ Lists, Tuples, Sets, Dictionaries                                               β•‘
    β•‘  β”œβ”€β”€ Conditionals (if/elif/else)                                                      β•‘
    β•‘  β”œβ”€β”€ Loops (for, while)                                                               β•‘
    β•‘  β”œβ”€β”€ Functions & Lambda Expressions                                                  β•‘
    β•‘  └── File I/O Operations                                                              β•‘
    β•‘                                                                                        β•‘
    β•‘  PHASE 2: INTERMEDIATE (Weeks 5-8)                                                    β•‘
    β•‘  β”œβ”€β”€ Object-Oriented Programming (Classes, Objects, Inheritance)                    β•‘
    β•‘  β”œβ”€β”€ Exception Handling                                                              β•‘
    β•‘  β”œβ”€β”€ Modules & Packages                                                               β•‘
    β•‘  β”œβ”€β”€ Virtual Environments                                                            β•‘
    β•‘  β”œβ”€β”€ Decorators                                                                       β•‘
    β•‘  β”œβ”€β”€ Generators                                                                      β•‘
    β•‘  β”œβ”€β”€ List/Dict/Set Comprehensions                                                    β•‘
    β•‘  β”œβ”€β”€ Working with JSON & CSV                                                          β•‘
    β•‘  └── Context Managers                                                                 β•‘
    β•‘                                                                                        β•‘
    β•‘  PHASE 3: ADVANCED (Weeks 9-12)                                                      β•‘
    β•‘  β”œβ”€β”€ Advanced OOP (Metaclasses, ABC, Multiple Inheritance)                          β•‘
    β•‘  β”œβ”€β”€ Async Programming (asyncio)                                                      β•‘
    β•‘  β”œβ”€β”€ Multithreading & Multiprocessing                                                β•‘
    β•‘  β”œβ”€β”€ Type Hints & Static Analysis                                                     β•‘
    β•‘  β”œβ”€β”€ Database Programming (SQL, NoSQL)                                               β•‘
    β•‘  β”œβ”€β”€ Testing (unittest, pytest)                                                       β•‘
    β•‘  β”œβ”€β”€ Design Patterns                                                                  β•‘
    β•‘  └── Performance Optimization                                                         β•‘
    β•‘                                                                                        β•‘
    β•‘  PHASE 4: SPECIALIZATION (Weeks 13+)                                                 β•‘
    β•‘  β”œβ”€β”€ Data Science & Machine Learning                                                  β•‘
    β•‘  β”œβ”€β”€ Web Development                                                                  β•‘
    β•‘  β”œβ”€β”€ Automation & Scripting                                                           β•‘
    β•‘  β”œβ”€β”€ API Development                                                                  β•‘
    β•‘  └── DevOps & Cloud                                                                    β•‘
    β•‘                                                                                        β•‘
    β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•


    ╔═══════════════════════════════════════════════════════════════════════════════════════╗
    β•‘                        PYTHON ECOSYSTEM OVERVIEW                                       β•‘
    ╠═══════════════════════════════════════════════════════════════════════════════════════╣
    β•‘                                                                                        β•‘
    β•‘                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                      β•‘
    β•‘                              β”‚   PYTHON CORE   β”‚                                      β•‘
    β•‘                              β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                      β•‘
    β•‘                                       β”‚                                               β•‘
    β•‘         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β•‘
    β•‘         β”‚                              β”‚                              β”‚               β•‘
    β•‘    β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”                   β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”                   β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”           β•‘
    β•‘    β”‚  WEB    β”‚                   β”‚   DATA  β”‚                   β”‚   DEV   β”‚           β•‘
    β•‘    β”‚ FRAMEWORKS                  β”‚   SCIENCEβ”‚                  β”‚   OPS   β”‚           β•‘
    β•‘    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€                   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€                   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€           β•‘
    β•‘    β”‚ Django  β”‚                   β”‚ NumPy    β”‚                   β”‚ Docker  β”‚           β•‘
    β•‘    β”‚ Flask   β”‚                   β”‚ Pandas   β”‚                   β”‚ Kube    β”‚           β•‘
    β•‘    β”‚ FastAPI β”‚                   β”‚ Matplotlibβ”‚                  β”‚ Terraformβ”‚          β•‘
    β•‘    β”‚ Pyramid β”‚                   β”‚ Scikit   β”‚                   β”‚Ansible  β”‚           β•‘
    β•‘    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β•‘
    β•‘                                                                                        β•‘
    β•‘    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β•‘
    β•‘    β”‚ AUTOMATION      β”‚         β”‚   AI/ML         β”‚         β”‚   TESTING      β”‚         β•‘
    β•‘    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€         β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€         β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€         β•‘
    β•‘    β”‚ Selenium        β”‚         β”‚ TensorFlow      β”‚         β”‚   pytest       β”‚         β•‘
    β•‘    β”‚ BeautifulSoup   β”‚         β”‚ PyTorch         β”‚         β”‚   unittest     β”‚         β•‘
    β•‘    β”‚ Scrapy          β”‚         β”‚ Keras           β”‚         β”‚   coverage     β”‚         β•‘
    β•‘    β”‚ Pillow         β”‚         β”‚ OpenCV          β”‚         β”‚   tox          β”‚         β•‘
    β•‘    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β•‘
    β•‘                                                                                        β•‘
    β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

πŸ”° What is Python?

Python Logo

Python is a high-level, interpreted programming language known for its:

Feature Description
Easy to Learn Clean syntax that reads like English
Versatile Used in Web, Data Science, AI, Automation, and more
Interpreted No compilation needed - runs line by line
Multi-paradigm Supports OOP, Functional, and Procedural programming
Cross-platform Works on Windows, macOS, Linux
Huge Ecosystem 400,000+ packages available

Why Learn Python in 2025/2026?

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    PYTHON POPULARITY                             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                  β”‚
β”‚  πŸ“Š TIOBE Index: #1 (Most Popular Programming Language)        β”‚
β”‚                                                                  β”‚
β”‚  πŸ“ˆ Stack Overflow: Most Loved Language (6 years running)      β”‚
β”‚                                                                  β”‚
β”‚  πŸ’Ό Job Market: High Demand with Competitive Salaries          β”‚
β”‚                                                                  β”‚
β”‚  🌐 Usage: Google, NASA, Netflix, Instagram, Spotify, NASA    β”‚
β”‚                                                                  β”‚
β”‚  πŸ”¬ Research: #1 Language in Data Science & Machine Learning   β”‚
β”‚                                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

βš™οΈ Setting Up Your Environment

Installing Python

Windows

# Method 1: Download from python.org
# Go to https://www.python.org/downloads/
# Download the latest version
# IMPORTANT: Check "Add Python to PATH"

# Method 2: Using Microsoft Store
python --version

# Verify Installation
python --version
pip --version

macOS

# Method 1: Using Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install python3

# Method 2: Download from python.org
# Go to https://www.python.org/downloads/mac-osx/

# Verify
python3 --version
pip3 --version

Linux (Ubuntu/Debian)

sudo apt update
sudo apt install python3 python3-pip python3-venv

# Verify
python3 --version
pip3 --version

Using Anaconda (Data Science)

# Download from https://www.anaconda.com/download
# Or use Miniconda (lightweight)
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh

# Verify
conda --version

Code Editors & IDEs

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              CODE EDITOR COMPARISON                                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚    Editor     β”‚    Type      β”‚   License    β”‚   Best For   β”‚        Pros/Cons           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  VS Code      β”‚    IDE       β”‚   Free       β”‚ General      β”‚ + Lightweight, Extensions   β”‚
β”‚               β”‚              β”‚              β”‚  Development β”‚ + Great Python Support      β”‚
β”‚               β”‚              β”‚              β”‚              β”‚ - Electron-based            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   PyCharm     β”‚    IDE       β”‚ Comm (Free)  β”‚ Large        β”‚ + Full-Featured            β”‚
β”‚               β”‚              β”‚ Prof (Paid)  β”‚  Projects    β”‚ + Best Autocomplete        β”‚
β”‚               β”‚              β”‚              β”‚              β”‚ - Heavy on Resources        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Jupyter      β”‚  Notebook    β”‚   Free       β”‚ Data Science β”‚ + Great for Experiments    β”‚
β”‚   Notebook    β”‚              β”‚              β”‚ & ML         β”‚ + Interactive              β”‚
β”‚               β”‚              β”‚              β”‚              β”‚ - Not for Large Projects    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   Sublime     β”‚   Editor     β”‚   Paid       β”‚ Quick        β”‚ + Extremely Fast           β”‚
β”‚   Text        β”‚              β”‚              β”‚  Editing     β”‚ + Minimalist               β”‚
β”‚               β”‚              β”‚              β”‚              β”‚ - Limited Python Support   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚    Vim        β”‚   Editor     β”‚   Free       β”‚ Terminal     β”‚ + Power User's Choice      β”‚
β”‚               β”‚              β”‚              β”‚  Users       β”‚ + Everywhere               β”‚
β”‚               β”‚              β”‚              β”‚              β”‚ - Steep Learning Curve     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

VS Code Setup (Recommended)

# 1. Download VS Code
# https://code.visualstudio.com/

# 2. Install Python Extension
# Open VS Code > Extensions (Ctrl+Shift+X) > Search "Python"

# 3. Essential Extensions
code --install-extension ms-python.python
code --install-extension ms-python.vscode-pylance
code --install-extension ms-toolsai.jupyter
code --install-extension ms-python.black-formatter

# 4. Configure Python Interpreter
# Ctrl+Shift+P > Python: Select Interpreter

Virtual Environments

# Create virtual environment
python -m venv myenv

# Activate (Windows)
myenv\Scripts\activate

# Activate (Mac/Linux)
source myenv/bin/activate

# Install packages
pip install package_name
pip install -r requirements.txt

# Create requirements.txt
pip freeze > requirements.txt

# Deactivate
deactivate

πŸ“š Python Fundamentals

1. Hello World

# The classic first program
print("Hello, World!")

# Multiple prints
print("Hello")
print("World")

# Print with variables
name = "Python"
print(f"Hello, {name}!")

# Print with formatting
print("Hello, {}!".format(name))
print("Hello, %s!" % name)

2. Variables & Data Types

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                             PYTHON DATA TYPES                                            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β”‚
β”‚  β”‚    NUMERIC      β”‚     β”‚     STRING       β”‚     β”‚    BOOLEAN      β”‚                  β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€                  β”‚
β”‚  β”‚  int    β†’ 42    β”‚     β”‚  str  β†’ "Hello"  β”‚     β”‚  bool β†’ True    β”‚                  β”‚
β”‚  β”‚  float  β†’ 3.14  β”‚     β”‚  str  β†’ 'Python' β”‚     β”‚  bool β†’ False   β”‚                  β”‚
│  │  complex→ 3+4j │     │  str  → """Multi │     │                 │                  │
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚       line str  β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚
β”‚                          β”‚       """       β”‚                                         β”‚
β”‚                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                         β”‚
β”‚                                                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β”‚
β”‚  β”‚    SEQUENCE     β”‚     β”‚     MAPPING     β”‚     β”‚     SET         β”‚                  β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€                  β”‚
β”‚  β”‚  list  β†’ [1,2]  β”‚     β”‚ dict β†’ {a:1}    β”‚     β”‚ set β†’ {1,2,3}    β”‚                  β”‚
β”‚  β”‚  tuple β†’ (1,2)  β”‚     β”‚                 β”‚     β”‚ frozenset      β”‚                  β”‚
β”‚  β”‚  range β†’ range β”‚     β”‚                 β”‚     β”‚                 β”‚                  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚
β”‚                                                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                                                     β”‚
β”‚  β”‚     NONE        β”‚                                                                     β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€                                                                     β”‚
│  │  NoneType→None  │                                                                     │
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                                                     β”‚
β”‚                                                                                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
# Numbers
age = 25              # int
price = 19.99         # float
complex_num = 3j      # complex

# Strings
name = "Python"
message = 'Hello'
multi_line = """This is
a multi-line
string"""

# Boolean
is_active = True
is_done = False

# None
result = None

# Checking types
print(type(age))      # <class 'int'>
print(type(name))     # <class 'str'>
print(type(is_active))# <class 'bool'>

# Type conversion
int_to_float = float(10)
float_to_int = int(10.5)
str_to_int = int("42")
num_to_str = str(123)

3. Operators

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              OPERATORS OVERVIEW                                         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                                          β”‚
β”‚  ARITHMETIC OPERATORS                    COMPARISON OPERATORS                            β”‚
β”‚  ═════════════════════                    ════════════════                              β”‚
β”‚  +   Addition           a + b = 13        ==  Equal             a == b                 β”‚
β”‚  -   Subtraction        a - b = 7         !=  Not Equal         a != b                 β”‚
β”‚  *   Multiplication    a * b = 30        >   Greater Than      a > b                  β”‚
β”‚  /   Division           a / b = 3.33     <   Less Than          a < b                  β”‚
β”‚  //  Floor Division     a // b = 3       >=  Greater/Equal      a >= b                 β”‚
β”‚  %   Modulus            a % b = 1        <=  Less/Equal         a <= b                 β”‚
β”‚  **  Exponent           a ** b = 1000                                                 β”‚
β”‚                                                                                          β”‚
β”‚  LOGICAL OPERATORS                      ASSIGNMENT OPERATORS                           β”‚
β”‚  ════════════════                       ══════════════                                 β”‚
β”‚  and  True if both True    x and y      =    Assign            a = 10                 β”‚
β”‚  or   True if either True  x or y       +=   Add & Assign      a += 5 (a = a + 5)    β”‚
β”‚  not  Inverts boolean      not x         -=   Subtract & Assign a -= 5                β”‚
β”‚                                           *=   Multiply & Assign  a *= 5                β”‚
β”‚  IDENTITY OPERATORS                     /=   Divide & Assign    a /= 5                β”‚
β”‚  ════════════════                                                                     β”‚
β”‚  is   True if same object  x is y       //=  Floor Div & Assign a //= 5               β”‚
β”‚  is not True if not same    x is not y   %=   Modulus & Assign   a %= 5                β”‚
β”‚                                           **=  Exponent & Assign  a **= 5               β”‚
β”‚  MEMBERSHIP OPERATORS                                                                       β”‚
β”‚  ════════════════                                                                     β”‚
β”‚  in    True if in        x in list                                                 β”‚
β”‚  not in True if not in   x not in list                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
# Arithmetic
a, b = 10, 3
print(a + b)    # 13
print(a - b)    # 7
print(a * b)    # 30
print(a / b)    # 3.333...
print(a // b)   # 3
print(a % b)    # 1
print(a ** b)   # 1000

# Comparison
print(a == b)   # False
print(a != b)   # True
print(a > b)    # True

# Logical
x, y = True, False
print(x and y)  # False
print(x or y)   # True
print(not x)    # False

# Identity
list1 = [1, 2]
list2 = [1, 2]
list3 = list1
print(list1 is list2)    # False
print(list1 is list3)     # True

4. Strings

text = "Hello, Python!"

# Accessing
print(text[0])           # H
print(text[-1])          # !

# Slicing
print(text[0:5])          # Hello
print(text[7:])          # Python!
print(text[::2])         # Hlo Ptno (every 2nd char)

# Methods
print(text.upper())                    # HELLO, PYTHON!
print(text.lower())                    # hello, python!
print(text.replace("Python", "World")) # Hello, World!
print(text.split(","))                 # ['Hello', ' Python!']
print(text.strip())                    # Remove whitespace
print(text.find("Python"))             # 7
print("Python" in text)                # True

# F-strings (recommended)
name = "Alice"
age = 30
print(f"My name is {name} and I'm {age} years old")
print(f"Price: ${price:.2f}")           # Formatted: Price: $19.99
print(f"Hex: {255:#x}")                 # Hex: 0xff

5. Collections

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           COLLECTIONS COMPARISON                                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   Feature    β”‚    List     β”‚    Tuple     β”‚     Set     β”‚        Dictionary           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Ordered     β”‚    βœ…       β”‚      βœ…      β”‚     ❌      β”‚           βœ… (3.7+)         β”‚
β”‚  Mutable     β”‚    βœ…       β”‚      ❌      β”‚     βœ…      β”‚           βœ…                 β”‚
β”‚  Indexed     β”‚    βœ…       β”‚      βœ…      β”‚     ❌      β”‚          By Key              β”‚
β”‚  Duplicates  β”‚    βœ…       β”‚      βœ…      β”‚     ❌      β”‚           ❌ (keys)         β”‚
β”‚  Syntax      β”‚   [1,2,3]   β”‚   (1,2,3)    β”‚   {1,2,3}   β”‚        {a:1, b:2}           β”‚
β”‚  Use Case    β”‚  Sequence  β”‚  Fixed data  β”‚  Unique     β”‚        Key-Value Pairs        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
# LIST - Mutable, ordered sequence
fruits = ["apple", "banana", "cherry"]
fruits.append("orange")
fruits.insert(1, "mango")
fruits.remove("banana")
fruits.pop()
print(fruits[0])
print(fruits[-1])

# TUPLE - Immutable, ordered sequence
coordinates = (10, 20, 30)
print(coordinates[0])  # 10

# SET - Unordered, unique elements
numbers = {1, 2, 3, 4, 5}
numbers.add(6)
numbers.update([7, 8])
numbers.remove(1)
print({1, 2, 3} | {3, 4, 5})  # Union: {1, 2, 3, 4, 5}
print({1, 2, 3} & {3, 4, 5})  # Intersection: {3}

# DICTIONARY - Key-value pairs
person = {"name": "John", "age": 30, "city": "NYC"}
print(person["name"])
print(person.get("age"))
person["email"] = "john@example.com"
print(person.keys())
print(person.values())
print(person.items())

6. Control Flow

# CONDITIONAL STATEMENTS
age = 18

if age < 13:
    print("Child")
elif age < 20:
    print("Teenager")
else:
    print("Adult")

# Ternary operator
status = "Adult" if age >= 18 else "Minor"

# MATCH STATEMENT (Python 3.10+)
status = "active"
match status:
    case "active":
        print("Running")
    case "paused":
        print("Paused")
    case _:
        print("Unknown")
# FOR LOOP
for i in range(5):              # 0, 1, 2, 3, 4
    print(i)

fruits = ["apple", "banana", "cherry"]
for fruit in fruits:
    print(fruit)

# With enumerate
for index, fruit in enumerate(fruits):
    print(f"{index}: {fruit}")

# WHILE LOOP
count = 0
while count < 5:
    print(count)
    count += 1

# LOOP CONTROL
for i in range(10):
    if i == 3:
        continue    # Skip this iteration
    if i == 7:
        break       # Exit loop
    print(i)

7. Functions

# Basic function
def greet(name):
    return f"Hello, {name}!"

# Default parameters
def greet(name, greeting="Hello"):
    return f"{greeting}, {name}!"

# Multiple parameters
def add(*args):
    return sum(args)

def person_info(**kwargs):
    for key, value in kwargs.items():
        print(f"{key}: {value}")

# Lambda functions
square = lambda x: x ** 2
add = lambda a, b: a + b

# Higher-order functions
numbers = [1, 2, 3, 4, 5]
squares = list(map(lambda x: x**2, numbers))
evens = list(filter(lambda x: x % 2 == 0, numbers))

# Decorators
def my_decorator(func):
    def wrapper(*args, **kwargs):
        print("Before function")
        result = func(*args, **kwargs)
        print("After function")
        return result
    return wrapper

@my_decorator
def say_hello():
    print("Hello!")

8. File Operations

# Read file
with open("file.txt", "r") as f:
    content = f.read()
    lines = f.readlines()

# Write file
with open("file.txt", "w") as f:
    f.write("Hello, World!")

# Append to file
with open("file.txt", "a") as f:
    f.write("\nNew line")

# Read CSV
import csv
with open("data.csv", "r") as f:
    reader = csv.reader(f)
    for row in reader:
        print(row)

# Work with JSON
import json
data = {"name": "John", "age": 30}
json_str = json.dumps(data)
parsed = json.loads(json_str)

πŸš€ Intermediate Python

1. Object-Oriented Programming

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              OOP CONCEPTS                                               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                                          β”‚
β”‚     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                                           β”‚
β”‚     β”‚       CLASS          β”‚  Blueprint for creating objects                            β”‚
β”‚     β”‚  (Blueprint)         β”‚  - Defines attributes (data)                               β”‚
β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  - Defines methods (behavior)                             β”‚
β”‚                β”‚                                                                   β”‚
β”‚                β”‚ creates                                                               β”‚
β”‚                β–Ό                                                                   β”‚
β”‚     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                                           β”‚
β”‚     β”‚       OBJECT         β”‚  Instance of a class                                      β”‚
β”‚     β”‚    (Instance)        β”‚  - Has its own state (attributes)                         β”‚
β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  - Can perform actions (methods)                          β”‚
β”‚                                                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                           OOP PRINCIPLES                                          β”‚   β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”‚
β”‚  β”‚                                                                                  β”‚   β”‚
β”‚  β”‚  1. ENCAPSULATION     β†’  Bundling data + methods together                       β”‚   β”‚
β”‚  β”‚  2. INHERITANCE       β†’  Reusing code from parent class                          β”‚   β”‚
β”‚  β”‚  3. POLYMORPHISM      β†’  Same interface, different implementations              β”‚   β”‚
β”‚  β”‚  4. ABSTRACTION       β†’  Hiding complex implementation                          β”‚   β”‚
β”‚  β”‚                                                                                  β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
# Class Definition
class Person:
    # Class attribute
    species = "Human"
    
    # Constructor
    def __init__(self, name, age):
        self.name = name        # Instance attribute
        self.age = age
    
    # Instance method
    def greet(self):
        return f"Hello, I'm {self.name}"
    
    # String representation
    def __str__(self):
        return f"Person({self.name}, {self.age})"
    
    def __repr__(self):
        return f"Person(name='{self.name}', age={self.age})"
    
    # Private method
    def _private_method(self):
        return "Private"

# Inheritance
class Student(Person):
    def __init__(self, name, age, grade):
        super().__init__(name, age)
        self.grade = grade
    
    def greet(self):
        return f"Hi, I'm {self.name} in grade {self.grade}"

# Create objects
person = Person("John", 30)
student = Student("Alice", 20, 10)

# Access
print(person.name)
print(person.greet())
print(Student.species)

2. Exception Handling

try:
    result = 10 / 0
except ZeroDivisionError:
    print("Cannot divide by zero!")
except Exception as e:
    print(f"Error: {e}")
else:
    print("No errors occurred")
finally:
    print("This always executes")

# Raising exceptions
def divide(a, b):
    if b == 0:
        raise ValueError("Divisor cannot be zero")
    return a / b

# Custom exception
class CustomError(Exception):
    pass

3. Modules & Packages

# Standard library modules
import math
import datetime
import random
import os
import sys

# Third-party modules
# pip install package_name
import numpy as np
import pandas as pd

# Create your own module
# mymodule.py
def my_function():
    return "Hello"

# Use it
import mymodule
mymodule.my_function()

# Import with alias
from datetime import datetime as dt
from math import sqrt, pi

4. Advanced Features

# List comprehension
squares = [x**2 for x in range(5)]
evens = [x for x in range(10) if x % 2 == 0]

# Dictionary comprehension
dict1 = {x: x**2 for x in range(5)}

# Generator
def count_up_to(n):
    i = 1
    while i <= n:
        yield i
        i += 1

counter = count_up_to(5)
print(next(counter))  # 1

# Generator expression
gen = (x**2 for x in range(5))

# Context manager
with open("file.txt", "r") as f:
    content = f.read()
# File automatically closed

🦾 Advanced Python

1. Advanced OOP

# Multiple Inheritance
class A:
    def method(self):
        print("A")

class B:
    def method(self):
        print("B")

class C(A, B):
    pass

# Method Resolution Order
print(C.__mro__)

# Abstract Base Classes
from abc import ABC, abstractmethod

class Animal(ABC):
    @abstractmethod
    def sound(self):
        pass

class Dog(Animal):
    def sound(self):
        return "Woof!"

# Metaclasses
class Meta(type):
    def __new__(cls, name, bases, dict):
        dict['added_attribute'] = 'Hello'
        return type.__new__(cls, name, bases, dict)

class MyClass(metaclass=Meta):
    pass

2. Async Programming

import asyncio

async def fetch_data():
    print("Fetching data...")
    await asyncio.sleep(2)
    return {"data": 123}

async def main():
    # Sequential
    result1 = await fetch_data()
    
    # Concurrent
    results = await asyncio.gather(
        fetch_data(),
        fetch_data()
    )

asyncio.run(main())

3. Multithreading & Multiprocessing

# Threading
import threading

def worker(number):
    print(f"Thread {number}")

threads = []
for i in range(5):
    t = threading.Thread(target=worker, args=(i,))
    threads.append(t)
    t.start()

for t in threads:
    t.join()

# Multiprocessing
import multiprocessing

def worker(number):
    print(f"Process {number}")

if __name__ == "__main__":
    with multiprocessing.Pool(5) as p:
        p.map(worker, range(5))

4. Type Hints

def greet(name: str) -> str:
    return f"Hello, {name}!"

def process_items(items: list[int]) -> dict[str, int]:
    return {"sum": sum(items)}

from typing import Union, Optional, Callable

def func(arg: Optional[str] = None) -> Union[str, int]:
    pass

def high_order_func(func: Callable[[int], int]) -> int:
    return func(10)

5. Database Programming

import sqlite3

# Create database
conn = sqlite3.connect("database.db")
cursor = conn.cursor()

# Create table
cursor.execute("""
    CREATE TABLE users (
        id INTEGER PRIMARY KEY,
        name TEXT,
        email TEXT
    )
""")

# CRUD Operations
cursor.execute("INSERT INTO users (name, email) VALUES (?, ?)", ("John", "john@example.com"))
cursor.execute("SELECT * FROM users")
rows = cursor.fetchall()
cursor.execute("UPDATE users SET name = ? WHERE id = ?", ("Jane", 1))
cursor.execute("DELETE FROM users WHERE id = ?", (1,))

conn.commit()
conn.close()

# Using SQLAlchemy (ORM)
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

6. Testing

# unittest
import unittest

class TestMathOperations(unittest.TestCase):
    def test_add(self):
        self.assertEqual(1 + 1, 2)
    
    def test_divide(self):
        with self.assertRaises(ZeroDivisionError):
            1 / 0

if __name__ == "__main__":
    unittest.main()

# pytest (install: pip install pytest)
def test_add():
    assert 1 + 1 == 2

πŸ“Š Python for Data Science

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         DATA SCIENCE TOOLKIT                                             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                   β”‚
β”‚  β”‚   NumPy     β”‚  β”‚   Pandas    β”‚  β”‚  Matplotlib β”‚  β”‚   Seaborn   β”‚                   β”‚
β”‚  β”‚  Numerical  β”‚  β”‚  Data       β”‚  β”‚  Plotting   β”‚  β”‚  Statisticalβ”‚                   β”‚
β”‚  β”‚  Computing  β”‚  β”‚  Analysis   β”‚  β”‚             β”‚  β”‚  Plotting   β”‚                   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β”‚
β”‚                                                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                   β”‚
β”‚  β”‚ Scikit-learnβ”‚  β”‚  TensorFlow β”‚  β”‚   PyTorch   β”‚  β”‚   Keras    β”‚                   β”‚
β”‚  β”‚   ML       β”‚  β”‚    Deep     β”‚  β”‚    Deep    β”‚  β”‚   High     β”‚                   β”‚
β”‚  β”‚  Library   β”‚  β”‚   Learning  β”‚  β”‚   Learning  β”‚  β”‚   Level APIβ”‚                   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β”‚
β”‚                                                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                   β”‚
β”‚  β”‚  OpenCV    β”‚  β”‚   NLTK     β”‚  β”‚  Spacy     β”‚  β”‚  Plotly    β”‚                   β”‚
β”‚  β”‚  Computer β”‚  β”‚  NLP       β”‚  β”‚  NLP       β”‚  β”‚  Interactiveβ”‚                   β”‚
β”‚  β”‚  Vision    β”‚  β”‚            β”‚  β”‚            β”‚  β”‚  Charts    β”‚                   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β”‚
β”‚                                                                                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Installation

pip install numpy pandas matplotlib seaborn scikit-learn tensorflow keras torch

NumPy Example

import numpy as np

# Create arrays
arr = np.array([1, 2, 3, 4, 5])
matrix = np.array([[1, 2], [3, 4]])

# Operations
print(arr * 2)          # [2, 4, 6, 8, 10]
print(np.mean(arr))      # 3.0
print(np.sum(arr))       # 15

Pandas Example

import pandas as pd

# Create DataFrame
data = {"Name": ["John", "Alice", "Bob"], "Age": [30, 25, 35]}
df = pd.DataFrame(data)

# Read from file
df = pd.read_csv("file.csv")
df = pd.read_excel("file.xlsx")

# Operations
print(df.head())
print(df.describe())
df.groupby("column").mean()
df.fillna(0)

🌐 Python for Web Development

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                          WEB DEVELOPMENT STACK                                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                                          β”‚
β”‚                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                          β”‚
β”‚                        β”‚   FRONTEND          β”‚                                          β”‚
β”‚                        β”‚   (JavaScript/HTML) β”‚                                          β”‚
β”‚                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                          β”‚
β”‚                                   β”‚                                                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                               β–Ό                                                  β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚   β”‚
β”‚  β”‚  β”‚                         BACKEND APIS                                        β”‚  β”‚   β”‚
β”‚  β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  β”‚   β”‚
β”‚  β”‚  β”‚                                                                              β”‚  β”‚   β”‚
β”‚  β”‚  β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                     β”‚  β”‚   β”‚
β”‚  β”‚  β”‚   β”‚   Django    β”‚    β”‚   Flask     β”‚    β”‚  FastAPI    β”‚                     β”‚  β”‚   β”‚
β”‚  β”‚  β”‚   β”‚  Full-Stack β”‚    β”‚  Micro      β”‚    β”‚  Async API  β”‚                     β”‚  β”‚   β”‚
β”‚  β”‚  β”‚   β”‚  Framework  β”‚    β”‚  Framework  β”‚    β”‚  Framework  β”‚                     β”‚  β”‚   β”‚
β”‚  β”‚  β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                     β”‚  β”‚   β”‚
β”‚  β”‚  β”‚                                                                              β”‚  β”‚   β”‚
β”‚  β”‚  β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                     β”‚  β”‚   β”‚
β”‚  β”‚  β”‚   β”‚  SQLAlchemy β”‚    β”‚  Pydantic   β”‚    β”‚   Celery    β”‚                     β”‚  β”‚   β”‚
β”‚  β”‚  β”‚   β”‚   ORM       β”‚    β”‚  Validation β”‚    β”‚  Task Queue β”‚                     β”‚  β”‚   β”‚
β”‚  β”‚  β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                     β”‚  β”‚   β”‚
β”‚  β”‚  β”‚                                                                              β”‚  β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚   β”‚
β”‚  β”‚                                       β”‚                                           β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                          β–Ό                                              β”‚
β”‚                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                          β”‚
β”‚                        β”‚    DATABASE         β”‚                                          β”‚
β”‚                        β”‚  PostgreSQL/MySQL   β”‚                                          β”‚
β”‚                        β”‚    SQLite/MongoDB   β”‚                                          β”‚
β”‚                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Django Example

# Install
pip install django

# Create project
django-admin startproject myproject
cd myproject
python manage.py startapp myapp

# models.py
from django.db import models

class Post(models.Model):
    title = models.CharField(max_length=200)
    content = models.TextField()
    created_at = models.DateTimeField(auto_now_add=True)
    
    def __str__(self):
        return self.title

# views.py
from django.shortcuts import render
from .models import Post

def post_list(request):
    posts = Post.objects.all()
    return render(request, 'post_list.html', {'posts': posts})

Flask Example

from flask import Flask, jsonify, request

app = Flask(__name__)

@app.route('/api/hello')
def hello():
    return jsonify({"message": "Hello, World!"})

@app.route('/api/posts', methods=['GET', 'POST'])
def posts():
    if request.method == 'POST':
        data = request.json
        return jsonify({"created": data})
    return jsonify({"posts": []})

if __name__ == '__main__':
    app.run(debug=True)

FastAPI Example

from fastapi import FastAPI
from pydantic import BaseModel

app = FastAPI()

class Item(BaseModel):
    name: str
    price: float
    is_offer: bool = None

@app.get("/")
def read_root():
    return {"Hello": "World"}

@app.post("/items/")
def create_item(item: Item):
    return item

# Run with: uvicorn main:app --reload

πŸ€– Python for Automation & Scripting

# Web Scraping with BeautifulSoup
from bs4 import BeautifulSoup
import requests

response = requests.get("https://example.com")
soup = BeautifulSoup(response.content, "html.parser")
print(soup.title.text)

# Selenium Automation
from selenium import webdriver

driver = webdriver.Chrome()
driver.get("https://example.com")
element = driver.find_element_by_name("q")
element.send_keys("Python")
element.submit()

# File Automation
import os
import shutil

# Copy, move, delete files
shutil.copy("source.txt", "dest.txt")
shutil.move("old.txt", "new.txt")
os.remove("file.txt")

# Schedule Tasks
import schedule
import time

def job():
    print("Task running")

schedule.every().day.at("10:00").do(job)

while True:
    schedule.run_pending()
    time.sleep(60)

πŸ’Ό Career Paths

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                            PYTHON CAREER PATHS                                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”‚
β”‚  β”‚  WEB        β”‚    β”‚  DATA       β”‚    β”‚  ML/AI      β”‚    β”‚  DEV OPS    β”‚              β”‚
β”‚  β”‚  DEVELOPER β”‚    β”‚  SCIENTIST  β”‚    β”‚  ENGINEER   β”‚    β”‚  ENGINEER   β”‚              β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€              β”‚
β”‚  β”‚ Salary:     β”‚    β”‚ Salary:     β”‚    β”‚ Salary:     β”‚    β”‚ Salary:     β”‚              β”‚
β”‚  β”‚ $80-150K    β”‚    β”‚ $90-160K    β”‚    β”‚ $100-200K   β”‚    β”‚ $90-170K    β”‚              β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€              β”‚
β”‚  β”‚ Skills:     β”‚    β”‚ Skills:     β”‚    β”‚ Skills:     β”‚    β”‚ Skills:     β”‚              β”‚
β”‚  β”‚ Django/Flaskβ”‚    β”‚ Pandas/NumPyβ”‚    β”‚ TensorFlow β”‚    β”‚ Docker/K8s  β”‚              β”‚
β”‚  β”‚ REST APIs   β”‚    β”‚ SQL/NoSQL   β”‚    β”‚ PyTorch    β”‚    β”‚ AWS/GCP     β”‚              β”‚
β”‚  β”‚ PostgreSQL  β”‚    β”‚ ML Algos    β”‚    β”‚ ML Ops     β”‚    β”‚ CI/CD       β”‚              β”‚
β”‚  β”‚ JavaScript  β”‚    β”‚ Visualizationβ”‚   β”‚ NLP        β”‚    β”‚ Terraform   β”‚              β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
β”‚                                                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                 β”‚
β”‚  β”‚  AUTOMATION β”‚    β”‚  SECURITY   β”‚    β”‚  GAME       β”‚                                 β”‚
β”‚  β”‚  ENGINEER   β”‚    β”‚  ENGINEER   β”‚    β”‚  DEVELOPER  β”‚                                 β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€                                 β”‚
β”‚  β”‚ Salary:     β”‚    β”‚ Salary:     β”‚    β”‚ Salary:     β”‚                                 β”‚
β”‚  β”‚ $70-130K    β”‚    β”‚ $90-180K    β”‚    β”‚ $60-120K    β”‚                                 β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€                                 β”‚
β”‚  β”‚ Skills:     β”‚    β”‚ Skills:     β”‚    β”‚ Skills:     β”‚                                 β”‚
β”‚  β”‚ Selenium    β”‚    β”‚ Penetration β”‚    β”‚ Pygame      β”‚                                 β”‚
β”‚  β”‚ Scripting   β”‚    β”‚ Testing     β”‚    β”‚ Unity (C#)  β”‚                                 β”‚
β”‚  β”‚ APIs        β”‚    β”‚ Security    β”‚    β”‚ 3D Graphics β”‚                                 β”‚
β”‚  β”‚ Linux       β”‚    β”‚ Cryptographyβ”‚    β”‚ Physics     β”‚                                 β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                 β”‚
β”‚                                                                                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“– Practice Resources

Interactive Platforms

Platform Focus Link
LeetCode Algorithms leetcode.com
HackerRank Practice hackerrank.com
Codewars Katas codewars.com
Exercism Mentored exercism.org
Project Euler Math/Code projecteuler.net

Tutorials & Documentation

Resource Description
Python.org Docs Official Documentation
Real Python In-depth Tutorials
W3Schools Python Beginner Friendly
Programiz Examples & Tutorials
GeeksforGeeks Computer Science

πŸ’‘ Project Ideas

Beginner (Week 1-4)

  • Number guessing game
  • Calculator
  • To-Do List CLI
  • Temperature converter
  • Simple password generator

Intermediate (Week 5-8)

  • Weather app using API
  • Web scraper
  • REST API
  • Blog with Flask/Django
  • Data visualization dashboard

Advanced (Week 9+)

  • Machine learning model
  • Chat application
  • E-commerce platform
  • Automation scripts
  • Full-stack web app

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


πŸ“„ License

MIT License - Feel free to use this roadmap for learning!


Made with ❀️ for Python Learners
Back to Top ↑

Releases

No releases published

Packages

 
 
 

Contributors