Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Teaching Python with three kinds of AI

Teaching Python with three kinds of AI

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.

Avatar for Reuven M. Lerner

Reuven M. Lerner

October 22, 2026

More Decks by Reuven M. Lerner

Other Decks in Technology

Transcript

  1. Teaching Python with three kinds of AI a Reuven M.

    Lerner • All-D y AI 2026 https://LernerPython.com
  2. In business since 1995 Courses • Exercises • Of ice

    hours • Discord • Projects Teaching Python with 3 types of AI f 2 Reuven M. Lerner • https://LernerPython.com
  3. I love exercises! Teaching Python with 3 types of AI

    3 Reuven M. Lerner • https://LernerPython.com
  4. My platform had them, too • Video introducing the exercise

    • 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
  5. Live exercises were better • People could ask questions during

    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
  6. But it wasn’t always perfect • People are embarrassed to

    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
  7. Agentic coding • Last year: Experimented with Claude Code. •

    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
  8. I kept saying: Shoot for the stars! Teaching Python with

    3 types of AI 8 Reuven M. Lerner • https://LernerPython.com
  9. Maybe I should do it, too! Teaching Python with 3

    types of AI 9 Reuven M. Lerner • https://LernerPython.com
  10. First AI: Creating the system • In-browser Python editor •

    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
  11. Short leash • Type hints and “mypy --strict” • TDD

    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
  12. Main architecture DB Browser FastAPI Claude Teaching Python with 3

    types of AI 12 Reuven M. Lerner • https://LernerPython.com
  13. I didn’t understand everything • Everything is in Docker •

    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
  14. The big win: In-browser Python • Python code runs in

    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
  15. Teaching Python with 3 types of AI 15 Reuven M.

    Lerner • https://LernerPython.com
  16. All of this was done with Claude Code Teaching Python

    with 3 types of AI 16 Reuven M. Lerner • https://LernerPython.com
  17. Design • How do you design something with Claude Code?

    • 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
  18. Git • The biggest challenge was Git • People have

    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
  19. Teaching Python with 3 types of AI 19 Reuven M.

    Lerner • https://LernerPython.com
  20. Superpowers • I didn’t do it all myself • The

    “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
  21. Integrating user feedback • Users report bugs and request features

    • 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
  22. Teaching Python with 3 types of AI 22 Reuven M.

    Lerner • https://LernerPython.com
  23. Teaching Python with 3 types of AI 23 Reuven M.

    Lerner • https://LernerPython.com
  24. Mistakes and problems • Docker growing over time • Using

    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
  25. Second AI: Socratic tutor • I wanted an automatic replacement

    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
  26. Pedagogy • We summaried my 30+ years of writing and

    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
  27. My voice as a robot • A “voice.md” ile is

    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
  28. People try to break it! • “Give me the answer”

    • 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
  29. Third AI: Analysis • The practice system also uses AI

    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
  30. Student submissions + chats • I can see student submissions

    • 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
  31. Teaching Python with 3 types of AI 31 Reuven M.

    Lerner • https://LernerPython.com
  32. In-class summary • I always review exercises with the class

    • 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
  33. Teaching Python with 3 types of AI 33 Reuven M.

    Lerner • https://LernerPython.com
  34. Teaching Python with 3 types of AI 34 Reuven M.

    Lerner • https://LernerPython.com
  35. Daily e-mail • Every morning, I get an AI-written summary

    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
  36. Teaching Python with 3 types of AI 36 Reuven M.

    Lerner • https://LernerPython.com
  37. Weekly e-mail • At a glance • Topic rollup •

    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
  38. Teaching Python with 3 types of AI 38 Reuven M.

    Lerner • https://LernerPython.com
  39. Teaching Python with 3 types of AI 39 Reuven M.

    Lerner • https://LernerPython.com
  40. Telemetry • The practice system has a lot of telemetry

    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
  41. I keep adding new features! • Pandas, Polars, and SQL

    • 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
  42. Wild problems • No JS tests (until I caught things)

    • 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
  43. Where does it stand now? • Used in my live

    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
  44. To date • 810 exercises across 46 courses • 15,700

    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
  45. You can try it, too! • https://practice.lernerpython.com • No fee

    • 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
  46. Teaching Python with 3 types of AI 46 Reuven M.

    Lerner • https://LernerPython.com
  47. Questions? • Reuven Lerner • [email protected] • LinkedIn: https://LinkedIn.com/in/reuven •

    YouTube: https://www.youtube.com/reuvenlerner • Better Developers: https://BetterDevelopersWeekly.com • Bamboo Weekly: https://BambooWeekly.com Teaching Python with 3 types of AI 47 Reuven M. Lerner • https://LernerPython.com