Roadmaps › Languages
Python Developer Roadmap
Learn Python from zero, write clean programs, automate tasks and build web APIs.
Level: Beginner → Intermediate · Duration: 3–4 months
Step 1: Python Basics
The simplest language to start coding with.
Python is known for clean, readable syntax, which makes it the easiest language to start with — yet it powers web backends, automation, data science and AI. Focus first on writing small working programs every day.
- Installing Python and running scripts
- Variables, types and operators
- Conditions and loops
- Functions
Resources: ▶ Python — 100 Days of Code · ▶ Chai aur Python · Python documentation · Python cheat sheet
Setup & first program
Install Python, run scripts, use the REPL.
Install Python 3, use an editor like VS Code, and learn to run code both as a script and in the interactive shell (REPL).
- Installing Python 3 and checking the version
- Running python file.py
- Using the REPL to try things quickly
- print() and input()
Variables & data types
int, float, str, bool; type conversion.
Python is dynamically typed: a variable gets its type from the value. Integers have no size limit, which removes overflow worries.
- int, float, str, bool and None
- Type conversion with int(), str(), float()
- Arithmetic including // and %
- f-strings for formatting output
Conditions & loops
if/elif/else, for, while, range.
Indentation defines blocks in Python. for loops iterate over anything iterable, and range() generates number sequences.
- if / elif / else
- for loops with range() and over lists
- while loops
- break, continue and the else clause on loops
Functions
Arguments, defaults, *args / **kwargs, return.
Functions package reusable logic. Python adds flexible arguments: defaults, keyword arguments and variable numbers of arguments.
- def, parameters and return
- Default and keyword arguments
- *args and **kwargs
- Scope: local vs global
Step 2: Data Structures
Built-in containers that make Python so productive.
Python's built-in data structures — lists, tuples, dictionaries and sets — are powerful and fast. Most Python code is about choosing and combining them well.
- Lists and tuples
- Dictionaries and sets
- Strings
- When to use which structure
Resources: Practice: Basics problems
Lists & tuples
Indexing, slicing, list comprehensions.
Lists are ordered and mutable; tuples are ordered and immutable. Slicing and list comprehensions make list work concise.
- Indexing, slicing and negative indices
- append, extend, insert, pop, sort
- List comprehensions
- Tuples and unpacking
Dictionaries & sets
Key-value lookups and unique items.
Dictionaries map keys to values with fast lookups; sets store unique items and support maths-like operations.
- Creating, reading and updating dicts
- Iterating with items()
- get() and setdefault()
- Set operations: union, intersection, difference
Strings
f-strings, split / join, common methods.
Strings are immutable sequences of characters with many built-in methods for searching, splitting and formatting.
- split, join, strip, replace, find
- Slicing and reversing strings
- upper/lower and checks like isdigit
- f-strings and format specifiers
collections module (optional)
Counter, defaultdict, deque.
The collections module adds specialised containers that make common tasks one-liners.
- Counter for frequency counts
- defaultdict for grouping
- deque for fast queue operations
- namedtuple
Step 3: OOP in Python
Organise bigger programs with classes.
Classes help organise larger programs by bundling data and behaviour. Python's OOP is simpler than Java's but supports the same ideas.
- Classes and objects
- Inheritance
- Special (dunder) methods
- Encapsulation conventions
Resources: Interview questions: OOP
Classes & objects
__init__, self, instance vs class attributes.
init sets up a new object and self refers to it. Class attributes are shared; instance attributes belong to each object.
- Defining a class and __init__
- Instance vs class attributes
- Methods, classmethod and staticmethod
- Private-by-convention names (_name)
Inheritance
super(), method overriding.
A child class reuses and extends a parent class. super() calls the parent's version of a method.
- Subclassing and super()
- Method overriding
- Multiple inheritance and MRO basics
Dunder methods
__str__, __repr__, __eq__, __len__.
Special methods like str and eq let your objects work with print, ==, len() and other built-ins.
- __str__ and __repr__
- __eq__ and __lt__
- __len__ and __iter__
Dataclasses (optional)
Less boilerplate for data-holding classes.
The @dataclass decorator writes init, repr and eq for you, perfect for classes that mainly hold data.
- @dataclass basics
- Default values and field()
- frozen dataclasses
Step 4: Files, Errors & Modules
Real programs read files and handle failures.
Real programs read and write files, handle errors gracefully and are split across modules and third-party packages.
- File input and output
- Exception handling
- Modules, packages and pip
- Virtual environments
File handling
open / with, reading and writing text and CSV.
Use with open(...) so files close automatically. The csv and json modules handle common formats.
- Reading and writing text files
- with statement
- csv and json modules
Exceptions
try / except / finally, raising your own errors.
try/except catches errors so your program can recover or show a helpful message instead of crashing.
- try / except / else / finally
- Catching specific exceptions
- raise and custom exception classes
Modules & packages
import, pip, virtual environments (venv).
Split code into modules and install libraries with pip. Virtual environments keep each project's packages separate.
- import and from … import
- pip install and requirements.txt
- python -m venv and activating it
- if __name__ == "__main__"
Step 5: Intermediate Python
Features that make code shorter and faster.
These features make Python code shorter, faster and more "Pythonic" — and they come up in interviews.
- Comprehensions and generators
- Decorators
- Functional tools
- Type hints
Comprehensions & generators
Lazy sequences with yield.
Comprehensions build lists, sets and dicts in one line. Generators produce values one at a time with yield, saving memory on large data.
- List, set and dict comprehensions
- Generator expressions
- yield and generator functions
- Iterators and next()
Decorators
Wrap functions to add behaviour.
A decorator wraps a function to add behaviour — logging, timing, caching, access checks — without changing its code. Frameworks like Flask use them for routes.
- Functions as objects and closures
- Writing a simple decorator
- functools.wraps
- functools.lru_cache
Lambda, map, filter
Small functional tools.
lambda creates small anonymous functions, often used with sorted, map and filter.
- lambda syntax
- sorted with key=
- map, filter and when comprehensions are clearer
Type hints (optional)
Annotations and mypy.
Type hints document what types a function expects and returns; tools like mypy check them.
- Annotating functions and variables
- list[int], dict[str, int], Optional
- Running mypy
Step 6: Automation & Scripting
Let Python do the boring work.
One of Python's biggest strengths is automating boring tasks: renaming files, fetching data, filling spreadsheets, sending reports.
- Working with files and folders
- Calling web APIs
- Scheduling scripts
os & pathlib
Rename, move and organise files.
pathlib and os let scripts create, move, rename and organise files and folders.
- pathlib.Path basics
- Listing, renaming and moving files
- Walking directory trees
Requests & APIs
Call web APIs and read JSON.
The requests library calls web APIs in a few lines; responses usually come back as JSON.
- GET and POST with requests
- Query params, headers and API keys
- Parsing JSON responses
- Handling errors and timeouts
Web scraping (optional)
BeautifulSoup (respect each site's rules).
When a site has no API, BeautifulSoup can extract data from its HTML. Always check the site's terms and robots.txt.
- Fetching pages and parsing HTML
- Selecting elements with BeautifulSoup
- Being polite: rate limits and robots.txt
Step 7: Web Development
Build APIs and websites with Python.
Python is a popular backend language. Flask and FastAPI are lightweight; Django includes almost everything a website needs.
- Choosing a framework
- Routes and request handling
- Connecting to a database
- Returning JSON for APIs
Resources: SQL documentation · ▶ Python Django Tutorials
Flask or FastAPI
Routes, request data, JSON responses.
Flask is minimal and easy to learn; FastAPI is fast, uses type hints for validation and generates API docs automatically.
- Defining routes and handling requests
- Path and query parameters
- Request validation (Pydantic in FastAPI)
- Running with uvicorn / flask run
Databases
SQLite / PostgreSQL with an ORM (SQLAlchemy).
Store data in SQLite for small apps or PostgreSQL for production, using an ORM like SQLAlchemy to work with Python objects instead of raw SQL.
- SQL basics
- SQLAlchemy models and sessions
- Migrations (Alembic)
Resources: PostgreSQL documentation
Django (optional)
Batteries-included framework with an admin panel.
Django is a full framework with an ORM, authentication, templates and a ready admin panel — great for building complete sites quickly.
- Projects, apps, models, views, templates
- The Django admin
- Django REST Framework for APIs
Step 8: Projects
Show what you can build.
Projects prove you can use Python to solve real problems. Build a few small but complete ones and put them on GitHub.
- Choosing useful, finishable projects
- Clean structure and a README
- Sharing them on GitHub
Resources: Git documentation
CLI tool
e.g. an expense tracker that saves to a file.
A command-line tool is a great first project: small, useful and complete — like an expense tracker or file organiser.
- Reading arguments with argparse
- Saving data to JSON or CSV
- Handling errors nicely
REST API
A FastAPI / Flask app with a database.
Build an API with Flask or FastAPI backed by a database — the kind of project backend roles look for.
- CRUD endpoints
- Database models
- Authentication with tokens
Deploy (optional)
Render / Railway, with Docker.
Deploy your API so anyone can use it — Render and Railway support Python apps directly from GitHub.
- requirements.txt and start command
- Environment variables
- Deploying with Docker (optional)
Resources: Docker documentation