Learn Python from Scratch: A Complete 2026 Roadmap

How to learn Python from zero: install a current version (including the new Windows install manager), then work through seven stages, from values and loops to files, virtual environments, classes and tests, each ending with a small program you should be able to write on your own.

GloryTecks Team

Training & Placement Faculty

14 June 2026 8 min read

Last updated: 24 September 2026

Share:

Learning Python from scratch has three parts, and beginners tend to focus on the first. There is the language itself: syntax, data types, functions. There are the tools around it: installing Python, running scripts, virtual environments, reading error messages. And there is practice, which is the part that turns recognising code into writing it. This roadmap covers all three, in an order where each stage uses what the previous one taught. Every stage ends with a small program you should be able to write without copying.

The backbone is the official Python tutorial, written by the people who maintain the language. It is free, accurate and concise. Where this roadmap says "read", it usually means a chapter of that tutorial. Where it says "write", it means close the tutorial and type.

Step 0: Install Python and learn to run a script

Install a current Python 3 release. At the time of writing that is Python 3.14, and the python.org downloads page always shows the latest version. On Windows the process changed with 3.14. The recommended route is now the Python Install Manager, from python.org or the Microsoft Store, which provides the python and py commands. The older full installer is deprecated and will not be produced for Python 3.16 or later (Using Python on Windows). Tutorials written before late 2025 describe the old installer, so expect small differences.

Then learn the two ways to run Python:

  • The interactive prompt (REPL): type python in a terminal and try expressions one line at a time. Good for experiments.
  • Scripts: save code in a file such as hello.py and run python hello.py. Real programs live in files.

Use any editor that runs a file with one keystroke. VS Code is a common choice, and IDLE, Python's own simple editor, is enough to start. Don't spend your first week configuring an editor.

Stage 1: Values, variables and text

Read the tutorial's informal introduction: numbers, strings, variables, print() and input(). Learn to convert between types, because input() always returns a string and "2" + "3" is "23", not 5. Learn f-strings early; they make output readable.

Write: a unit converter that asks for a distance in kilometres and prints it in miles, rounded to two decimal places. Then make it refuse an empty answer.

Stage 2: Decisions and loops

Learn if/elif/else, for loops over range() and over collections, while loops, and break and continue. This is also when indentation stops being a formatting detail and starts being syntax. In Python, the indentation is the block.

Write: a number-guessing game. The program picks a random number from 1 to 100 using the random module, the player guesses, and the program says "higher" or "lower" and counts the attempts.

Stage 3: Lists, dictionaries, sets and tuples

Data structures are where Python becomes useful for real work. Learn what each one is for. A list is an ordered collection you change. A tuple is a fixed record. A dictionary looks values up by key. A set holds unique items and answers membership questions fast. Learn list and dictionary comprehensions once loops feel natural. Our Python data structures reference goes deeper on each.

The standard library already solves many beginner problems. Counting words, for example, is three lines with collections.Counter:

python
from collections import Counter
import re

text = "The cat sat on the mat. The dog sat too."
words = re.findall(r"[a-z']+", text.lower())
for word, count in Counter(words).most_common(3):
    print(word, count)
text
the 3
sat 2
cat 1

Write: the same program without Counter, using a dictionary you update yourself. Then read a text file instead of a hard-coded string. Writing it both ways teaches you what the library is doing for you.

Stage 4: Functions, modules and error messages

Functions are how programs stay readable past fifty lines. Learn parameters and return values, default arguments, and the difference between printing a value and returning it. Then learn to split code across files and import it.

This is also the stage to learn to read a traceback, a skill beginners often avoid and one of the most useful. Take a function that parses an amount:

python
def parse_amount(text):
    return float(text)

print(parse_amount("12.50"))
print(parse_amount("12,50"))

The first call prints 12.5. The second fails:

text
Traceback (most recent call last):
  File "amounts.py", line 5, in <module>
    print(parse_amount("12,50"))
          ^^^^^^^^^^^^^^^^^^^^^
  File "amounts.py", line 2, in parse_amount
    return float(text)
           ^^^^^^^^^^^
ValueError: could not convert string to float: '12,50'

Read it from the bottom up. The last line names the error and the value that caused it. The lines above trace the calls that led there, and the most recent call is listed last. Here the fix is to decide what the function should do with a comma: convert it, or reject the input clearly.

python
def parse_amount(text):
    try:
        return float(text.replace(",", "."))
    except ValueError:
        return None

for raw in ["12.50", "12,50", "twelve"]:
    print(raw, "->", parse_amount(raw))
text
12.50 -> 12.5
12,50 -> 12.5
twelve -> None

Catch the specific exception you expect, here ValueError, not every exception. A bare except: hides the bugs you most need to see. Our guide to error handling in Python covers the patterns in more depth.

Write: take the guessing game from stage 2, split it into functions, and make it survive a player typing "fifty".

Stage 5: Files, JSON and packages

Most useful programs read something and save something. Learn to open files with with, work with paths using pathlib, and read and write CSV and JSON with the standard library's csv and json modules.

Then learn virtual environments, before you install your first third-party package. A virtual environment is an isolated set of installed packages for one project, created on top of your Python installation (venv documentation):

bash
python -m venv .venv
# Windows (PowerShell):  .venv\Scripts\Activate.ps1
# macOS / Linux:          source .venv/bin/activate
python -m pip install requests

Using python -m pip rather than a bare pip makes sure the package goes into the Python you are actually running, which is the approach the Python Packaging User Guide uses throughout. Our article on virtual environments with venv, pip and Poetry compares the options.

Write: a command-line expense tracker. It adds an expense with a category and amount, lists expenses, and shows totals by category, and it saves everything to a JSON file between runs.

Stage 6: Classes, tests and style

Learn classes when you have a reason to: when several functions keep passing the same group of values around, a class can bundle them. Cover attributes, methods, __init__, and when a plain dictionary or a dataclass is simpler.

Learn to test at the same time. A test is a small program that checks another program, and it is what lets you change code without fear. Start with pytest or the built-in unittest. Our pytest guide for beginners walks through a first test suite. Read PEP 8, Python's style guide, once, and let a formatter handle the rest.

Write: refactor the expense tracker so expenses are objects, and add tests for the totals, including an empty file and a malformed amount.

Stage 7: Choose a direction

With stages 1–6 done you can write, debug and organise ordinary programs. What comes next depends on why you are learning Python:

If you want to…Learn nextStart with
Work with dataNumPy, pandas, visualisation, SQLOur data science roadmap
Build web back endsHTTP, REST, a framework such as FastAPI or DjangoA small API that stores data in SQLite
Automate workFile handling, requests, scheduling, working with Excel filesA script that replaces a task you do by hand every week
Build AI applicationsCalling model APIs, prompt design, retrievalA command-line tool that summarises a document

Pick one. The language skills transfer between them, so the choice is less permanent than it feels.

How long it takes, and how to plan it

Nobody can give you an honest number of weeks without knowing your hours and your background, so plan by checkpoints instead of dates. A workable rhythm is short, frequent sessions, where most of the time goes on writing code and a smaller share on reading. If you can manage around an hour a day, aim for one stage every one to two weeks. The checkpoint programs are the real measure: if one takes far longer than expected, that is a signal to slow down and revise, not to skip ahead.

Two habits speed things up more than any study plan. Type code rather than pasting it, because the mistakes you make while typing are the lessons. And finish small programs, because a finished 40-line program teaches more than an abandoned 400-line one. When you want more practice at each stage, our list of Python projects for beginners is ordered to match this roadmap.

Mistakes that slow beginners down

  • Watching instead of writing. Videos feel productive and leave no trace in your hands.
  • Naming variables after built-ins. Calling a variable list or str breaks the built-in for the rest of the file.
  • Changing a list while looping over it. Loop over a copy, or build a new list.
  • Ignoring the error message. The last line of a traceback usually tells you exactly what went wrong.
  • Installing packages globally. Use a virtual environment for every project from the start.

If you would rather follow a set syllabus, the GloryTecks Python Programming course teaches the same core language and then applies it to data work.

GloryTecks Team

Training & Placement Faculty

The GloryTecks faculty team mentors learners across Data Science, AI and Data Engineering, with a focus on real-time projects and placement readiness in Hyderabad.

Want to master Python?

Join GloryTecks’ expert-led Python Programming training in Hyderabad with real-time projects and 100% placement support.

Explore course