What Is the Best Way to Learn Python? (A 6-Week Plan)

Two coworkers asked me this month for the best way to learn Python. Each had watched about ten hours of a video course and still couldn’t write a ten-line script without pausing the video.

That’s the most common way people stall. Watching someone else code feels like progress, but your fingers never learn the syntax. You need to type, run and break small programs from day one.

Quick answer: install the latest Python, learn the basics from the official tutorial, and write one small script a week that solves a real problem. Read every error before you search it. Short daily practice beats a 40-hour course you only watch.

In this tutorial, I’ll share what I think is the best way to learn Python: a six-week plan with four real scripts, how to read a traceback, which free resources are worth your time, and the mistakes that slow beginners down.

What is the best way to learn Python in 2026?

Learn by building. Pick a goal, like automating a chore or analyzing some numbers, and learn just enough syntax to move toward it each day. If you’re still deciding whether the language fits your goals, read whether Python is a good language to learn first.

Here’s the setup I’d use today. It takes about 20 minutes and you only do it once:

  • Install Python from python.org. The newest release when I checked on 11/05/2026 was Python 3.15.2; on Windows, tick Add python.exe to PATH in the installer.
  • Install a free editor. I use VS Code with Microsoft’s Python extension, but any editor that can run a file works.
  • Make one folder for practice, such as C:\pyguides, and save every exercise there with a clear name.
  • Bookmark the official Python tutorial on docs.python.org. It’s free, current and written by the people who build the language.

I ran every script below on Python 3.14.8, the build I keep for testing. Nothing in this plan needs features newer than that, so 3.14 or 3.15 both work. If you’re curious what actually executes your code, see how the Python interpreter works.

Note: plan on about an hour a day, five or six days a week. Shorter daily sessions stick better than one long weekend binge.

Week 1: Write and run your first Python script

Skip the 30-minute history lesson. Your first job is to save a .py file and run it. If running files is new to you, my guide on running a Python script covers the terminal, IDLE and VS Code.

Here’s the first program I give beginners. It splits a restaurant bill with a 20% tip among three friends, which uses numbers, variables, math and formatted output in 12 lines:

bill = 86.40
tip_rate = 0.20
people = 3

tip = bill * tip_rate
total = bill + tip
share = total / people

print(f"Bill:  ${bill:.2f}")
print(f"Tip:   ${tip:.2f}")
print(f"Total: ${total:.2f}")
print(f"Each of {people} pays ${share:.2f}")

Output:

Bill:  $86.40
Tip:   $17.28
Total: $103.68
Each of 3 pays $34.56
VS Code running a first Python script that splits an $86.40 restaurant bill with a 20% tip among three people
The script prints the bill, the tip, the total and each person’s share of $34.56.

Now change it: set people = 4, try a 15% tip, or add a sales-tax line. Each change teaches you more than rereading the lesson. My post on Python variables explains what each name on the left side really holds.

By Friday of week 1, you should be comfortable with numbers, strings, f-strings, input() and if/else. The official tutorial’s sections 3 and 4 cover exactly that.

Week 2: Practice Python lists, loops and functions on one budget

Week 2 is where most of the real programming happens: storing many values in a list, looping over them, and wrapping logic in a function you can reuse. Same money theme, now one week of expenses:

expenses = [64.18, 41.90, 23.75, 38.62, 39.15, 31.40]
budget = 250.00


def summarize(amounts, limit):
    spent = sum(amounts)
    left = limit - spent
    status = "under" if left >= 0 else "over"
    return spent, left, status


spent, left, status = summarize(expenses, budget)
print(f"Spent ${spent:.2f} of ${budget:.2f}")
print(f"You're {status} budget by ${abs(left):.2f}")

big = [x for x in expenses if x > 40]
print(f"Purchases over $40: {big}")

Output:

Spent $239.00 of $250.00
You're under budget by $11.00
Purchases over $40: [64.18, 41.9]

The function returns three values at once, and the last line keeps only purchases over $40, which gives two of them. The whole week came to $239.00, so the script reports $11.00 under budget.

That last line is a list comprehension. It’s worth learning early, because you’ll see it in almost every Python file; my list comprehension guide walks through it slowly.

Also learn the difference between for and while this week. A quick way to see it is for loop vs while loop in Python, which uses the same kind of small examples.

Pro Tip: add a print() inside the loop when something looks wrong. Seeing each value as it changes is the fastest debugger a beginner has.

How do you read a Python error message?

Every beginner hits errors constantly, and that’s fine. The skill that separates people who keep going from people who quit is reading the error before pasting it into a search box. Here’s a mistake I see weekly:

spent = 239.00
print("You spent $" + spent)

Traceback:

Traceback (most recent call last):
  File "C:\pyguides\pydemo\spent.py", line 2, in <module>
    print("You spent $" + spent)
          ~~~~~~~~~~~~~~^~~~~~~
TypeError: can only concatenate str (not "float") to str
VS Code showing a Python TypeError traceback after joining a string and a float with the plus sign
The traceback points at line 2 and the last line names the problem: Python won’t join text and a float.

Read a traceback from the bottom up. The last line gives the error type and the reason; the lines above say which file and line number. Here that’s line 2, where + tries to glue a string to a float.

Python doesn’t convert numbers to text for you. Convert it yourself with str(), or use an f-string with a format spec:

spent = 239.00
print("You spent $" + str(spent))
print(f"You spent ${spent:.2f}")

Output:

You spent $239.0
You spent $239.00

str() prints $239.0, because a float drops the trailing zero; only the f-string gives the $239.00 a dollar amount needs. Once you can read one traceback, the rest look familiar; IndexError: string index out of range is another one you’ll meet in week 2.

Week 3: Read CSV files in Python and handle bad data with try/except

Real data lives in files, and real files contain junk. Week 3 is about opening a CSV file, reading it row by row, and surviving a bad value instead of crashing. Save this as expenses.csv next to your script:

date,category,amount
03/02/2026,Groceries,64.18
03/02/2026,Gas,41.90
03/03/2026,Dining,23.75
03/04/2026,Groceries,38.62
03/05/2026,Dining,N/A
03/06/2026,Gas,39.15
03/07/2026,Dining,31.40

One row says N/A instead of an amount, just like an export from a banking app might. The script totals spending by category and skips that row with a message:

import csv

totals = {}
skipped = 0

with open("expenses.csv", newline="") as f:
    for row in csv.DictReader(f):
        raw = row["amount"]
        try:
            amount = float(raw)
        except ValueError:
            print(f"Skipping {row['date']}: bad amount {raw!r}")
            skipped += 1
            continue
        cat = row["category"]
        totals[cat] = totals.get(cat, 0) + amount

for cat, amount in sorted(totals.items()):
    print(f"{cat:<10} ${amount:>7.2f}")
print(f"Rows skipped: {skipped}")

Output:

Skipping 03/05/2026: bad amount 'N/A'
Dining     $  55.15
Gas        $  81.05
Groceries  $ 102.80
Rows skipped: 1
VS Code output of a Python script that reads expenses.csv, skips a row with an N/A amount and totals spending by category
The bad 03/05/2026 row is reported and skipped; Dining, Gas and Groceries get their totals.

float("N/A") raises ValueError, and the try/except block catches it so the loop keeps going. When one block needs to catch more than one error type, see catching multiple exceptions in Python.

The with open(...) line closes the file for you, even if an error happens. Once reading works, try the other direction with writing a list to a CSV file.

Week 4: Build a small Python project of your own

Now stop following my examples and build something you’d actually use. Mine was a study log: it tracks how long I practice each day and finds my longest streak, which keeps me honest during this plan.

from datetime import datetime, timedelta

log = [
    ("11/02/2026", 45), ("11/03/2026", 30), ("11/04/2026", 60),
    ("11/06/2026", 40), ("11/07/2026", 50), ("11/08/2026", 35),
    ("11/09/2026", 55), ("11/11/2026", 25),
]


def parse(day):
    return datetime.strptime(day, "%m/%d/%Y").date()


def longest_streak(days):
    best = run = 1
    for prev, cur in zip(days, days[1:]):
        run = run + 1 if cur - prev == timedelta(days=1) else 1
        best = max(best, run)
    return best


days = [parse(d) for d, _ in log]
minutes = sum(m for _, m in log)
print(f"Study days: {len(days)}")
print(f"Total time: {minutes // 60} h {minutes % 60} min")
print(f"Longest streak: {longest_streak(days)} days")
print(f"Last session: {days[-1]:%A, %m/%d/%Y}")

Output:

Study days: 8
Total time: 5 h 40 min
Longest streak: 4 days
Last session: Wednesday, 11/11/2026
VS Code output of a Python study-log project showing eight study days, 5 h 40 min total and a four-day longest streak
Eight logged days add up to 5 h 40 min, and the longest run of back-to-back days is four.

The project pulls in everything from weeks 1-3: a list of tuples, two functions, a loop, f-strings and the datetime module from the standard library. The last session lands on Wednesday, 11/11/2026.

Other beginner-sized ideas: a grocery price tracker, a random workout picker, a file renamer for your photos, or a quiz on state capitals. When a project grows past one file, read building a simple OOP project in Python to see how classes keep it organized.

Important: keep each project small enough to finish in a week. A finished 80-line script teaches more than an abandoned 2,000-line app.

Weeks 5-6: Pick one Python track (web, data, automation or AI)

After four weeks you know core Python. Now pick one direction and learn its main library, inside a