Python for beginners: where to start (write a loop today)

Start by running code today — in the next twenty minutes, before you've compared four courses, installed anything, or worked out whether you're "a maths person." The most reliable way to lose your first month is to spend it deciding how to spend it. Below is the script to write first, the three errors to cause on purpose, and a seven-day plan specific enough to argue with.

Python for beginners: where to start

Write something that runs. That's the answer, and the rest of this post is detail underneath it. A 40-hour video course feels like progress because it's measurable — 12% complete, three modules down — but the thing being measured is hours watched. Nobody was ever hired on hours watched.

So here's a first script that isn't hello world. It has a list, a loop, a decision, and a running total, which is roughly the skeleton of half the code you'll ever write:

prices = [12.50, 4.00, 8.75, 21.30]
total = 0

for price in prices:
    total = total + price
    if price > 10:
        print(f"{price} — over ten")

print(f"total: {total}")
12.5 — over ten
21.3 — over ten
total: 46.55

Look at the first line of that output. You typed 12.50 and Python printed 12.5, because a float is a number, not the text you typed it in. That's a small thing that will confuse you again in six months with real money on the line — and you just met it on day one for free. That's what running code buys you over reading about it.

Now break it on purpose

Most of programming is reading errors, and beginners treat their first traceback as a verdict instead of a message. Fix that today: misspell a variable and run it again.

Traceback (most recent call last):
  File "prices.py", line 5, in <module>
    total = total + pirce
                    ^^^^^
NameError: name 'pirce' is not defined. Did you mean: 'price'?

Read it bottom-up: error type, message, the line, the file. Python is telling you the name doesn't exist and guessing what you meant. It isn't angry with you.

Do it twice more. Delete the colon at the end of the for line — now you get a SyntaxError, and the caret points at where the parser gave up, which isn't always where you went wrong. Then indent the last print one level too far and watch the total print inside the loop, four times, with no error at all. Silent wrong behaviour is the third category, and it's the one that costs real hours later.

What about installing Python?

You'll want a local install eventually — a real project needs a real environment, and you should learn what a virtualenv is well before you learn what a Docker image is. Not today, though. On day one, installing Python is a way to spend three hours in a terminal, learn nothing about programming, and finish the evening with a PATH problem and no code written.

If you want the version answer: Python 3, whatever the current release is, and whichever editor you already have open. If you'd rather not deal with any of it yet, ProdQuest runs the editor, terminal, and Python itself in the browser — WebAssembly, no install, nothing to configure. Typical time from signing up to a first completed, graded task is under 15 minutes, which is the entire point: the fifteen minutes go into the task, not the setup.

The real beginner problem isn't syntax

Syntax is small. Python's core is maybe fifteen keywords you'll actually use, and you can hold the genuinely useful parts of the standard library in your head. What stalls people is not knowing what to attempt next — the task you pick yourself is either so easy it teaches nothing, or so far past you that you spend an hour copying code you can't read.

That's why ProdQuest opens with an initial assessment instead of a syllabus, and why the mentor holds your task difficulty in the 70–80% success band afterwards, adjusting after every submission. Not because 75% is a magic number, but because that band is where you're stretched enough to learn something and not stuck enough to close the tab. Learning alone, you have to be your own difficulty dial: when three tasks in a row feel effortless, the next one should be uncomfortable.

A first week you can actually follow

Not "learn the basics." Instructions:

DayTimeWhat you write
130 minThe price script above. Then break it three ways and read all three results.
245 minSwap the list for a dict — {"coffee": 12.50, "tea": 4.00} — and print only the items over ten, with their names. You'll meet .items().
345 minMove the sum into def total_of(prices): that returns the number instead of printing it. Call it twice, with different lists.
445 minCall total_of([]). Then total_of([12.50, "free"]). Decide what each one should do — then make it do that.
51 hNo new syntax. Add assert total_of([1, 2]) == 3 under your function. Then write an assert you expect to fail, and run it.
61 hTake your day-3 file, introduce three bugs, close it for an hour, then fix it without rewriting it.
730 minRe-read the day-1 script. If nothing about it bothers you now, days 2–6 didn't happen.

Day 4 matters most and looks least like learning Python. Deciding what an empty list should do is the first time you're making an engineering call rather than following an instruction, and that decision — return zero, raise, log and skip — is exactly the kind of thing a code review argues about. Beginners are usually told to postpone it for months. Don't.

If you're switching careers, the honest number

A week gets you writing small programs without a tutorial open. It does not get you employable, and anyone selling the second thing on the first timeline is selling. The fundamentals — syntax, data structures, enough OOP to build and test something small on your own — run to roughly 60–100 hours of active practice, and the multiplier isn't talent. It's how much of that time sits at the right difficulty instead of being re-watched.

Which is decent news if you're doing this around a job. Five focused hours a week, each with a failing test somewhere in it, will take you further than a heroic weekend once a month — because what you're building is a habit of reading errors and making calls, and habits don't respond to cramming.

Start with the loop. If you'd rather have the first task picked for your actual level, graded by real tests, and explained when it's wrong, join the closed beta — the initial assessment does the choosing, so you can skip the part where you choose.