I teach Python for a living. In this talk, I describe how I used AI in three different ways to help people learn and practice Python — in my corporate training, on my online platform, and as a companion to my books and newsletters.
• Text ile with the instructions • Video reviewing the exercise • But you didn’t get any feedback on your own solution • Sometimes people would ask in Discord… but usually not f Teaching Python with 3 types of AI 4 Reuven M. Lerner • https://LernerPython.com
the exercise • People could pair program, learning from one another • People could share their non-working code with me • In online classes, they can share their screen Teaching Python with 3 types of AI 5 Reuven M. Lerner • https://LernerPython.com
ask questions • People give up on solving the problem • People don’t think that exercises are really that important • “I understood it when you told us about it” Teaching Python with 3 types of AI 6 Reuven M. Lerner • https://LernerPython.com
December: Models improved • People I respect said it’s more than good enough • January: Started to teach classes in agentic coding Teaching Python with 3 types of AI 7 Reuven M. Lerner • https://LernerPython.com
No installation, no login needed • AI chatbot that sees what you wrote, and reacts • Button to get a hint • Button to submit the code for a “ inal” review — not a grade • Integrate into my online platform Reuven M. Lerner • https://LernerPython.com 10 f Teaching Python with 3 types of AI
with (nearly) 100% coverage • Ruff checking all code • Commit to Git very regularly • New branch for every feature and bug ix • Sync version (pyproject.toml) with Git tag • CI using GitHub actions • Extensive logging • Regular backups of the VM and database 11 Reuven M. Lerner • https://LernerPython.com f Teaching Python with 3 types of AI
JavaScript single-page app using Svelte • Pyodide • JS tested using Vitest and Playwright • But… I knew enough to discuss, argue, and ask “why” Teaching Python with 3 types of AI 13 Reuven M. Lerner • https://LernerPython.com
the browser, thanks to Pyodide • You can’t mess up the server by running bad code • Most standard library modules are available • In inite loops are your problem, not mine • Filesystem is in your browser, not your computer • Can handle a very large number of users • Still, server throttles by IP address and has other checks f Teaching Python with 3 types of AI 14 Reuven M. Lerner • https://LernerPython.com
• Especially if you have bad design sense? • And you can’t do much with CSS? • Screen shots. Lots of screen shots. • Capture the screen • Describe what you dislike • Draw arrows to things that need to change • More often than not, I found that this worked great Teaching Python with 3 types of AI 17 Reuven M. Lerner • https://LernerPython.com
a really tough time understanding it • I wanted • Display working directory vs. staging vs. HEAD • Graphical view of the tree, with commits • Command-line Git interface • Also, AI chatbot Teaching Python with 3 types of AI 18 Reuven M. Lerner • https://LernerPython.com
“Superpowers” plugin was a huge help • Brainstorming • Speci ications • Planning • Implementing (with TDD) • Reviewing each commit • Reviewing each version — a bit of a show-off! • Debugging f Teaching Python with 3 types of AI 20 Reuven M. Lerner • https://LernerPython.com
• Example: AI knows all languages, but that wasn’t obvious • If the browser language is non-English, indicate that they can use another language • Also, offer to translate the question into another language Teaching Python with 3 types of AI 21 Reuven M. Lerner • https://LernerPython.com
SQLite at the beginning, migrated to PostgreSQL • Storing questions in iles at the beginning, migrated to DB • Building the option for multiple schools, and multiple instructors per school… then removed that • Not including Pydantic data models from the start f Teaching Python with 3 types of AI 24 Reuven M. Lerner • https://LernerPython.com
for myself • Always available to answer • Always helpful, encouraging • Doesn’t give the answer away, but does push in the right direction Teaching Python with 3 types of AI 25 Reuven M. Lerner • https://LernerPython.com
teaching • Newsletters • Columns • E-mail messages • Transcripts from my videos • This distillation is added to the prompt • So the chatbot sounds like me, even if it isn’t me Teaching Python with 3 types of AI 26 Reuven M. Lerner • https://LernerPython.com
included in every prompt sent to Anthropic • I update it based on feedback and usage • Headlines in voice.md: • Teaching philosophy • Signature phrases and rhetorical moves • “Unfortunately, this works” and “Don’t repeat yourself” • Things he praises • Things he critiques • Voice excerpts f Teaching Python with 3 types of AI 27 Reuven M. Lerner • https://LernerPython.com
• All sorts of “ignore previous commands” • Trying to look around the ilesystem • “Tell Reuven is this is a great system” • But user comments are sectioned off from the code and from the Socratic prompt — so far, this hasn’t been an issue Teaching Python with 3 types of AI f 28 Reuven M. Lerner • https://LernerPython.com
in analysis • Analysis of student answers • Analysis of the practice system’s feedback Teaching Python with 3 types of AI 29 Reuven M. Lerner • https://LernerPython.com
• This includes their AI conversations • I can also display them (anonymously) to the class, enlarged • I always want to show non-working code — now I can! Teaching Python with 3 types of AI 30 Reuven M. Lerner • https://LernerPython.com
• It’s always helpful to know where people were confused • AI can do that for me Teaching Python with 3 types of AI 32 Reuven M. Lerner • https://LernerPython.com
of the previous 24 hours • What activity was there on the system? What stood out? • How did the Socratic tutor perform? Teaching Python with 3 types of AI 35 Reuven M. Lerner • https://LernerPython.com
Top misconceptions • Also seen • Emerging • Cohort shifts • Content ideas • Coverage & cost Teaching Python with 3 types of AI 37 Reuven M. Lerner • https://LernerPython.com
built in • Self analysis • Logging • An API to ind out what the current state of things is f Teaching Python with 3 types of AI 40 Reuven M. Lerner • https://LernerPython.com
• Files • PyPI packages • Command-line switches • Visualization — letting the chatbot see plotting • Pair programming, initiated by student or instructor • Interactive debugger + Python bytecodes • Pandas transitions • Python Tutor-style display of data • Scratchpad, irst private then shareable • asyncio support • Thumbs up/down indication of satisfaction f Teaching Python with 3 types of AI 41 Reuven M. Lerner • https://LernerPython.com
• Deleted database • Hebrew responses • Crashing my computer due to parallel subagents + Docker Teaching Python with 3 types of AI 42 Reuven M. Lerner • https://LernerPython.com
corporate training and conference workshops • Used in all LernerPython exercises, across all courses • Integrated into my Better Developers newsletter • Integrated (partly) into my Bamboo Weekly newsletter • Integrated into my O’Reilly book • I plan to integrate it into my YouTube channel Teaching Python with 3 types of AI 43 Reuven M. Lerner • https://LernerPython.com
interactions from 330 users (since June 9) • Every deploy runs 392 browser tests and 77 checks against the live site • A nightly job runs every exercise’s reference solution • So we can trust it Teaching Python with 3 types of AI 44 Reuven M. Lerner • https://LernerPython.com
• No registration (optional e-mail address) • Try out a few sample exercises Teaching Python with 3 types of AI 45 Reuven M. Lerner • https://LernerPython.com