AI Wrote It. Now What?
Checking Python You Didn’t Write
AI Wrote It. Now What? Checking Python You Didn’t Write
Checking AI-Written Python • 4 Hours • 2 Live Sessions
You can produce more code than you can read. This course closes the gap.
Hosted By

Core Team member at Real Python and the author of Object-Oriented Programming in Python. He teaches Real Python's Intermediate Python Deep Dive cohort and brings the same hands-on approach to this course.
The code runs. That’s usually where the checking stops.
You asked for something, you got a few hundred lines back, you skimmed them, and nothing looked obviously wrong. It ran. You moved on.
“It works. I think.”
“I’d have written this differently, but I couldn’t tell you what’s actually wrong with it.”
“I asked for one small change and it rewrote half the file.”
The uncomfortable part is what happens next. When something turns out to be wrong days later, the usual move is to paste the error back in and ask again. Sometimes that works. When it doesn’t, there’s no second move.
Code that runs is not code that works, and the gap between those two is where your time is going.
We asked 62,753 developers what they were struggling with, and people already building with AI kept landing in the same place:
“Vibe coding and not really understanding what is taking place ‘under the hood’.”
“I can play with llm models, agentic coding. But I don’t know the underlying things.”
“Overreliance on coding agents, and lack of awareness of possibilities to adequately direct.”
This isn’t a gap in your Python. It’s a gap in something nobody was ever taught, because until recently nobody had to read this much code they didn’t write.
What Makes This Course Different
Twenty Lines You Write Once, Then Use on Everything
In the first half hour you write a small script by hand. It runs a piece of code, shows you what actually came back rather than what you assumed, checks it against what you expected, and times it.
Then every piece of model-generated code for the rest of the course goes through it, and the habit is what you’re really taking home.
The rest of the course is bugs. Real ones, prepared in advance, every one of which runs perfectly:
- an exception caught and quietly swallowed, so a failure looks like a success
- numbers that are secretly strings, and the total that concatenated them
- an off-by-one in a slice that only shows up on the last row
- money in floats
- a timezone that moves a date by a day for about a fifth of your users
None of these crash. All of them are wrong. You’ll find each one, then write the single line that would have caught it.
By the second session it turns around: you’ll be handed working code and asked to find the input that ruins it. That’s a harder exercise, and it’s the one that stays with you.
Course Curriculum
Two live 2-hour sessions on Zoom. Everything is hands-on — there’s no segment where you only watch.
Session 1: Does It Run, and What Did It Actually Do?
By the end of this session, you'll have a script you wrote yourself that tells you what a piece of code really did, and you'll have found three bugs that never raised an error.
What you'll write: The check-it script, by hand, in the first half hour.
What you'll learn:
- How to see what came back rather than what you assumed came back
- The three lines of a traceback that matter, and the scaffolding you can ignore
- How to interrogate an object you've never seen before and find out what it will and won't do
- Why a swallowed exception is worse than a crash
- Three failures that run cleanly and are wrong anyway
Session 2: Is It Right, and Is It Right on Data You Didn’t Expect?
By the end of this session, you'll have broken working code on purpose and know when to stop asking the model and fix it yourself.
What you'll write: The assertions that catch each bug, the inputs that break your neighbor's code, and the message you send when you do go back to the model.
What you'll learn:
- The wrong answers that look plausible: string numbers, off-by-ones, float money, timezones, encodings
- How to write the one check that would have caught each of them
- What happens to code on empty input, one row, a duplicate, a missing field
- When a correction is worth making yourself and when the whole approach is wrong
- What to say when you do ask again, and why pasting the traceback back in rarely works
- The prediction test: five snippets that all run, and you name the bug before we show it
Next cohort: dates to be announced
Join the Waitlist →Be First in Line When Dates Are Announced.
Real Python Satisfaction Guarantee
This course is backed by Real Python's guarantee. You can receive a full refund within 14 days after the course ends, provided you meet the completion criteria in our refund policy.What You’ll Be Able to Do
- Read a failure and fix it without pasting the error back in and hoping
- Find the wrong answer in code that ran perfectly and raised nothing
- Tell the difference between a correction worth making yourself and an approach that needs rethinking
What You’ll Receive
- 2 live 2-hour sessions via Zoom
- Cohort forum with the instructor and your peers, before and after the sessions
- The check-it script, the twenty lines you wrote in the first half hour
- The bug catalog: every wrong-but-runs failure we worked through, each with the one line that catches it
- The traceback method as a one-page procedure, and the template for asking a model again when it's worth doing
- Lifetime access to the recordings and materials
Who This Course Is For
#1
Faster Than You Can Read — you're accepting code you couldn't have written and couldn't quite explain
#2
Out of Practice — your Python was fine two years ago and you've hand-written much less of it since
#3
The Reluctant Reviewer — your team ships agent-written code and you're the one reviewing it, ready or not
Who Should Not Take This Course?
You need to have written some Python. There has to be something to sharpen. If you’re still learning the basics, start with Real Python’s Python Basics Learning Path instead.
This isn’t a testing course. Assertions turn up here as a way of catching today’s bug, not as a methodology. If you want pytest properly, that’s a different thing.
And it isn’t about how agents work inside. We never open the lid. If that’s the question you have, take AI Agents for Python Developers.
Meet Your Instructor

Core Team member at Real Python and acclaimed Python educator who combines years of teaching expertise and storytelling techniques to make complex programming concepts clear, engaging, and unforgettable.
Stephen Gruppetta is a seasoned Python educator and author known for his engaging narrative approach to explaining complex concepts, drawing on his PhD in physics and years as a lecturer and technical writer.
With experience ranging from corporate training to creating accessible resources like The Python Coding Book, he’s dedicated to helping learners master Python with clarity and creativity.
Why Learn With Real Python?
Real Python started as a Kickstarter project in 2012. Today, over 1 million developers, data scientists, and ML engineers read it every month.
Our content goes through what very few Python resources match:
- Expert technical review for accuracy
- Teaching specialist evaluation for learning effectiveness
- Professional editing for clarity
Our live courses bring that same review process to an interactive, instructor-led format. You get the questions, the live discussion, and a community that’s been learning Python with us since 2012.
What Learners Say About
Stephen’s Courses
“I felt like I was a really well-studied Python beginner… But I couldn’t quite get out of there to the next level. And [Stephen's course] is helping because it’s all about that deeper understanding.”
“I can look at modules, I can look at other people’s code and I understand why they’re doing what they’re doing. And it’s not just taking things for granted anymore… I can go on and start exploring more complex things without immediately getting lost.”
— Jerry Wilson, Technical Lead at AIM EMS Software
“Ever since we’ve been taking the course, I’ve really changed a lot of the way that I’m programming.”
“It’s definitely given me more confidence to go deep dive into things I just took for granted… But after this course I feel much stronger in being able to understand the fundamentals of why things work in Python that it’s given me more confidence to go deeper.”
— Matt Thacker, Sr. Solutions Engineer at Eptura
Why This Course Works
Knowing a rule changes nothing at the moment somebody hands you a number.
You can read every article ever written about float arithmetic and still accept a total that’s three cents off, because nothing about it looked wrong. Verification is a reflex rather than a fact, and reflexes come from repetition.
So that’s what this course is: repetition, on code that runs and lies.
Every bug is a kind you’ll meet in real code, and every one is ready to go, so the whole session is spent finding them.
And the second session turns the exercise around. Session 1 is “here’s a bug, find it”. Session 2 is “here’s your working code, here’s the input that ruins it”, which is harder and is the part that transfers to everything you do afterward.
How This Differs From Our Other AI Courses
Claude Code and Codex teach you to get good output from a specific tool. This one starts after the output exists.
AI Agents for Python Developers is about how an agent works inside. This one never opens the lid — the code is just there, and the question is whether it’s right.
Building Python Projects With AI Agents is the closest neighbor and the natural next step. That course is about judging design at project scale — structure, responsibilities, what happens when requirements change. It assumes you can already read code and form an opinion about it.
This one is upstream of that, and it’s about correctness at snippet scale. One course asks whether something is well built. This one asks whether it’s right.
Frequently Asked Questions
You need to have written some Python. Specifically, you should be comfortable with:
- Writing and calling functions
- Working with dictionaries and lists
- Running Python scripts from the command line
You don’t need to be fluent, and you don’t need any experience with AI agents. What you do need is something to sharpen.
No. The people it’s built for are often years into a career — the gap it fills doesn’t track experience level. Somebody six years in who now prompts all day has the same gap as somebody six months in.
What’s new is the situation rather than the skills. Until recently, nobody had to read this much code they didn’t write.
Short version: the Claude Code and Codex courses teach you to get good output from a tool, AI Agents for Python Developers is about how an agent works inside, and Building Python Projects With AI Agents is about judging design across a whole project.
This one sits upstream of all of them and asks the narrowest question: is this piece of code right, and how would you know? There’s a fuller comparison further up the page.
We generate them in advance and pick the ones that teach exactly one thing each. That’s deliberate: nothing in this course depends on a model misbehaving live, so the failures are guaranteed and the time goes on finding them.
You code along throughout. There’s no segment where you only watch. The second session in particular has you breaking other people’s working code with inputs they didn’t consider, which only works if everyone’s hands are on a keyboard.
Python 3.12 or newer, your editor of choice, and Zoom. Every snippet we work on is supplied, so there’s nothing to buy and no API access required.
Yes. You’ll keep the check-it script, the bug catalog with the assertion that catches each one, the traceback method, the re-ask template, and the session recordings.
Dates and times haven’t been announced yet. Join the waitlist and you’ll be the first to hear when they are, before the course is opened up more widely.
Each session is recorded and posted shortly afterward, so you can catch up on your own schedule. We’d rather you came live, since most of the value is in working through the bugs together, but the recording will be ready before the next session starts.
Every cohort gets a dedicated forum that runs from before the first session through to after the last. Stephen is based in UTC+1 and monitors the forum throughout his working day.
Yes. Select the number of seats you need on the booking page when the cohort opens. Each team member will receive their own access to the course materials and recordings.
This course is backed by Real Python’s satisfaction guarantee. You can receive a full refund within 14 days after the course ends, provided you meet the completion criteria in our refund policy.
Have another question? Email us at info@realpython.com