Category: Learning and AI Literacy

  • PyLearn Overview – Programming and AI Literacy for Young Learners

    PyLearn Overview – Programming and AI Literacy for Young Learners

    Students today grow up in two digital worlds that look similar on the surface but work completely differently underneath. In the world of programming, behavior is defined by explicit rules: the computer does exactly what was written, step by step, and every result can be traced back to a concrete cause. In the world of AI, outputs may look convincing and useful, but they are generated as plausible predictions — not as transparent, traceable reasoning.

    For beginners, both worlds can feel equally “smart” from the outside, even though they operate on fundamentally different principles. This course exists to make that distinction visible and intellectually usable. The aim is not to teach as much Python syntax as possible, but to help learners understand how digital systems produce behavior, where control lies, and how to judge the reliability of an output.

    You can find more technical details here: PyLearn: Using AI to Help Kids Learn Python Without Skipping the Thinking


    Why This Approach Is Different

    Many current offers either teach coding without addressing AI at all, or introduce AI as a shortcut that bypasses actual understanding. Here, programming and AI are not blended into one vague “digital creativity” topic — they are taught as two separate modes of thinking that students (between 11-14) must learn to compare, evaluate, and use deliberately.

    AI is part of the course from early on, but in a controlled progression: first as an explanation tool, then as a source of suggestions, and only later as an agent that can propose concrete code changes. This sequence is intentional. Students need a solid mental model of deterministic code before they can meaningfully evaluate probabilistic AI output. A learner who can write a small program but cannot judge whether AI output is flawed remains dependent on systems they do not understand. A learner who grasps the difference gains something more durable: technical judgment.


    Personal note: The software is done, the concept below also.

    BUT: Still I have not done the sessions, the concept needs to be proved in real-live 🙂

    This will happen the next months. I will keep you posted. If you are interested in trying this out, or if you have any good suggestion, you are more then welcome to contact me.


    How a Lesson Works — Four Sessions

    The course runs in four focused sessions of roughly 90 minutes each. Each session has a clear theme, and they build on each other — skills and AI tools are introduced in deliberate sequence. Teachers do not need to be Python experts. The platform is designed so the teacher’s role is facilitation and discussion, not live debugging.

    Session 1 — Pure Logic, No AI

    Students open PyLearn and immediately have a small working program in front of them. The first task is not to write code — it already runs. The task is to predict what it does, run it, and then change it. What happens if you add another name? What if the comparison is wrong? This phase builds a mental model: code is a machine with traceable cause and effect, not a black box.

    In the second phase, a deliberate error is introduced and students ask the AI — in Chat mode only — to explain it. The AI explains. The student fixes it. The AI is explicitly not allowed to write the fix. This is the first experience of AI as explainer, not solver — and many students find it frustrating in exactly the right way.

    Session 2 — Adventure: Logic Becomes Visible

    Session 2 is where motivation spikes. Students see a background image appear, text render over it, and characters move — all triggered by a few lines of pure Python if/else logic. The pylearn library handles the visual layer, so students experience that code creates behavior in a structured and inspectable way: choices have consequences, state changes, and the program responds.

    By the end of this session, students use Suggestion mode for the first time: they ask “how do I add a second question?” and receive a hint. They then implement it themselves — the suggestion is a scaffold, not a paste target.

    Session 3 — Build From Scratch

    Students plan a short adventure story on paper first — Start → Decision 1 → Decision 2 → End — before touching the editor. They then build it independently, without AI assistance. Only in the later phase do they bring in Suggestion mode to compare ideas.

    Then Agent mode appears for the first time: the AI proposes a concrete code change, shown as a highlighted diff. Students see exactly which lines would be added or removed. They decide whether to accept. This makes the AI’s intervention visible and deliberate — not a background process that silently rewrites their work.

    Session 4 — The Comparison

    The final session is the most intellectually demanding. Students solve the same task twice: once on their own, then by asking the AI to do it. They place both solutions side by side and answer concrete questions: Does the AI’s version work? Is it better, or just different? Where does it fail? What did the AI produce that you wouldn’t have — and why?

    Students close the session by distinguishing the three AI roles — Chat, Suggestion, Agent — and explaining when each is appropriate. That reflection is the final assessment.

    A note for teachers: The progression of AI access across sessions is not arbitrary. Chat-only → Suggestion → Agent follows a ladder of increasing AI involvement, deliberately timed so students have built enough understanding to evaluate what the AI proposes before they are allowed to accept it. Skipping ahead breaks the didactic logic.


    Getting Started — For Teachers

    PyLearn runs in the browser — no installation needed for students or teachers. The first person to log in via Google automatically becomes the teacher and has full admin access.

    • Create student accounts — go to the Admin Dashboard → Students, create an account, share the PIN with the student
    • Prepare starter programs — write a program in the Programs panel and assign it to students before the lesson
    • Set the AI mode — choose OFF, Chat, Suggest, or Agent for the whole classroom; change it at any point mid-session
    • Monitor students — click any student name in the dashboard to view their current screen live; you can also edit their code directly to support them
    • Activate Cheat Sheets — enable quick-reference cards for students mid-session when they need a syntax reminder
    • Manage AI credits — each AI request costs one credit; reset credits per student to prevent overuse

    Getting Started — For Students

    Your teacher will give you a login PIN. Open the PyLearn URL in your browser, enter your name and PIN, and you are in — no account registration, no app to install.

    • Open a program — click a file in the Files panel on the left; programs your teacher has assigned appear there automatically
    • Run your code — press the Run button; output appears immediately in the Output panel on the right
    • Use the AI — the AI panel is on the right side; what it can do depends on the mode your teacher has set for the lesson
    • Ask for help — click the “Need Help” button in the status bar; your teacher will be notified and can look at your screen
    • Upload images — for adventure programs, upload your own background images or sprites in the Images tab of the Files panel

    Platform Guide

    Teacher: Admin Dashboard

    The Admin Dashboard is your control centre during a session. From here you manage students, distribute programs and prompts, configure AI behaviour, and monitor every student’s screen in real time.

    Teacher admin dashboard overview

    Student Management

    Create student accounts and share the login PIN. You can pause individual students, reset their AI credit (a credit is spent each time a student uses AI, preventing overuse), and re-activate accounts at any time.

    Student management panel

    Programs

    Write starter programs in advance and assign them to students. When assigned, the program appears in the student’s file list and they work on their own copy — the teacher’s original stays unchanged.

    Programs panel

    Prompts & Cheat Sheets

    Prompts work the same way as programs — write a prompt template and assign it to students to guide their AI interaction for that session. Cheat Sheets are quick-reference cards (Python syntax, commands to remember) that you activate for students mid-session. Once activated, they become visible in the student’s interface.

    AI Mode Configuration

    This is the most important control for the didactic progression. You set the AI mode for the whole classroom from here, and you can change it at any point during a lesson. Each mode can also have a custom system prompt that is silently added to every student request — so you can, for example, instruct the AI to never give complete solutions.

    ModeWhat the AI doesCan it change code?
    OFFAI panel hidden — pure programming, no AINo
    ChatConversational Q&A, concept explanationsNo
    SuggestHints and improvement ideasNo
    AgentProposes concrete code changes as a visible diffYes — student must accept
    AI configuration panel

    Student Workspace

    When a student logs in, they see a single page with four areas working together.

    Status Bar

    • Connection indicator — green means the student is live and connected to the server
    • Cheat Sheet button — appears when the teacher has activated a cheat sheet for the session
    • Need Help button — sends a help request to the teacher; the teacher can then view and edit the student’s screen directly

    Workspace Panels

    • Files / Images — select a Python program to work on (including teacher-assigned starters) and upload images for adventure scenes
    • Code Editor — a full Python editor with syntax highlighting (same editor used in VS Code)
    • Output Window — shows program output, terminal text, graphics, and adventure scenes; can be expanded to full screen
    • AI Assistant — available in Chat, Suggest, or Agent mode as configured by the teacher; in Agent mode, proposed code changes appear as a highlighted diff before the student accepts them
    Student workspace overview

    PyLearn Python Library — Command Reference

    The pylearn library is a single Python module that gives students immediate visual output without any external installation. It supports adventure scenes, sprites, dialogue, text overlays, turtle graphics, and charts — all rendering directly in the output panel.

    Quick Command Reference

    scene(name)
    show_sprite(name, x, y)
    show_sprite(name, x, y, size)
    move_sprite(name, x, y)
    move_sprite(name, x, y, duration)
    show_text(id, text, x, y)
    show_text(id, text, x, y, size, color, background)
    clear_text(id)
    clear_text()
    say(text)
    say(text, color, size, background)
    ask(question)
    ask(question, color, size)

    Parameters Explained

    name        # Name of an image or background, without .png or .jpg
    id          # Name of a text field, used to update or delete it later
    text        # Text to display
    question    # Question shown to the player
    x           # Position left to right, 0 to 500
    y           # Position top to bottom, 0 to 500
    size        # Width for sprites, font size for text
    duration    # Duration of a movement in seconds
    color       # Text colour, e.g. "white", "yellow", "cyan", "green"
    background  # Background colour, e.g. "#000000"

    Note: Adventure mode and Turtle mode cannot be mixed in the same program. Use either Adventure or Turtle.


    Complete Example

    from pylearn import scene, show_sprite, move_sprite, show_text, clear_text, say, ask
    scene("forest")
    show_text("title", "Das Wald-Abenteuer", x=130, y=20, size=28, color="yellow")
    show_sprite("hero", x=50, y=300, size=100)
    show_sprite("devil", x=350, y=280, size=100)
    say("Du wachst in einem dunklen Wald auf.")
    say("Vor dir steht ein kleiner Teufel.")
    move_sprite("hero", x=180, y=300, duration=1)
    answer = ask("Was machst du? kämpfen oder fliehen?")
    if answer == "kämpfen":
        say("Du ziehst dein Schwert und stellst dich dem Teufel.")
        show_text("status", "Mut: +10", x=10, y=10, color="green")
    else:
        say("Du rennst schnell zurück zum sicheren Dorf.")
        move_sprite("hero", x=30, y=350, duration=1)
        show_text("status", "Sicherheit: +10", x=10, y=10, color="cyan")

    Key Rules to Remember

    The program does exactly what you tell it. You are the one building the rules of the world.

    • scene() sets the background image
    • show_sprite() places a character or object on screen
    • move_sprite() moves a character to a new position
    • show_text() displays text at a fixed position on the scene
    • clear_text() removes a text element (or all of them)
    • say() adds a line to the story dialogue below the scene
    • ask() shows a question and waits for the player’s input

  • PyLearn: Using AI to Help Kids Learn Python Without Skipping the Thinking

    PyLearn: Using AI to Help Kids Learn Python Without Skipping the Thinking

    “Can’t I just ask ChatGPT?” That’s the question you get within two minutes of starting any programming course with kids today. The honest answer is: yes, you can — but if that becomes the default, you skip the part that actually matters. That tension is exactly why I built PyLearn, a browser-based Python learning platform. And the real story isn’t about Python at all.

    Who is this for? Teachers with a coding streak, developers who occasionally teach, or anyone running a programming club who’s been wondering how to handle the AI question constructively — rather than ignoring it or banning it.

    >>>> More information, detailed description and course concept is available here: PyLearn Overview

        

    Two Mental Models That Need to Stay Separate

    Programming is deterministic. A student writes if score > 80: print("Top"), and the computer does exactly that — every time, no interpretation, no opinion. When something breaks, there is always a traceable reason, and the student can find it.

    AI is the opposite. It produces plausible output based on patterns — often useful, occasionally wrong in ways that look completely convincing. Teaching kids to use AI tools without first building this distinction is like teaching someone to drive while telling them autopilot handles everything.

    The actual learning goal of PyLearn is to make kids feel both of these things, in contrast, through their own hands.

    How the Progression Feels for a Student

    Students never face a blank editor — every exercise starts with working code they modify. The first session is pure Python, no AI, no shortcuts. Kids predict what a small program will do before running it, build the mental model that cause produces effect, and fix their own errors. The AI isn’t even visible yet.

    Then, from the teacher dashboard, the AI gets switched on — but in Chat mode only. The bot explains errors. It does not fix them. Students fix them. This one constraint, enforced at the configuration level rather than just asked of students, is what prevents the habit of delegating thinking the moment something gets uncomfortable.

    Session two introduces the Adventure module — and this is where kids sit up. Two lines:

    from pylearn import scene, say
    scene("forest")
    say("Du stehst am Waldrand.")

    A background appears. A text overlay. Suddenly if/else isn’t abstract — it’s a dragon appearing depending on what you type. Sprites have coordinates. Choices change the scene. State has consequences. The pylearn library handles all the rendering through a single import, with no pip install and no boilerplate, because it lives directly on the server’s Python path.

    By the final session, kids compare their own solution to one the AI generates for the same task — and they have the vocabulary to evaluate it: Is it correct? Is it better? What did it miss?

    The Core Feature: Centrally Controlled AI Behavior

    This is what makes PyLearn architecturally different from just “an editor with a chatbot”. The teacher configures AI behavior for the entire classroom from a single dashboard — switchable live, mid-session, without touching any student’s browser.

    The database schema tells the story directly — there are four distinct system prompts, one per mode, all editable:

    ModeWhat the AI doesCan touch code?
    OffBlocked entirely — students work aloneNo
    ChatExplains AI concepts, no coding helpNo
    SuggestionHints and nudges, guides toward solutionNo
    AgentProposes a concrete diff, student must acceptOnly with approval

    When Agent mode proposes a change, students see it as an inline diff — green additions, red removals — before deciding to accept or reject. The AI never silently rewrites their work. This makes the “AI as collaborator you stay responsible for” idea concrete rather than a slogan.

    And because all prompts are stored in the database and editable through the dashboard, a teacher can deliberately tune the AI to be too verbose, answer in the wrong language, or give subtly wrong hints — to make the point that these systems fail and need to be checked.

    Feature List

    • Four AI modes (Off / Chat / Suggestion / Agent) — configurable per classroom, switchable live
    • Fully editable system prompts per mode — stored in DB, tweak the AI’s personality or strictness without a redeploy
    • Inline diff review in Agent mode — students see exactly what changes before accepting
    • Single shared API key — one teacher account covers all students; no student sign-ups, no per-student billing (Anthropic Claude or Google Gemini, configurable)
    • Real-time student monitoring — teacher dashboard shows every student’s current editor and terminal output live
    • Help request system — students can signal they’re stuck; teacher sees a queue of active requests
    • PIN-based student login — no email, no password manager, no friction for 12-year-olds
    • Monaco editor (VS Code engine) + xterm.js terminal with real Python 3 running server-side via PTY
    • pylearn library — single-file, zero dependencies, no pip install; supports Adventure scenes, Turtle graphics, Plotly charts, and HTML output out of the box
    • Image/background upload  — students can use custom assets in adventure scenes
    • fly deploy one-liner — ships with fly.toml and Dockerfile, auto-stops when idle, runs cheap

    Extensible by Design

    Because Python runs as a real server-side process, adding libraries is a Dockerfile line. Want pandas? Add it. Matplotlib? Done. The pylearn Adventure library is the default on-ramp for visual immediacy, but the architecture doesn’t lock you there — Turtle graphics already work out of the box, and the output panel renders anything the backend sends.

    Get It

    The full source is at happychriss/pylearn on GitHub — open source, active classroom use, ~14 students aged 11–14. If you run a coding club, teach CS at a school, or just want a controlled environment where you decide how much AI your students can reach for and when, it might save you a lot of setup time.

    One honest note: the hardest part isn’t the deployment. It’s resisting the urge to turn Agent mode on in session one. The contrast only works if the students have something to compare against.

    A meta-note worth adding: PyLearn itself was built using Claude Code — AI-assisted development from the start. What that taught me is the same lesson the course teaches kids: you need to genuinely understand the architecture and the underlying technology to be able to fix things, revise decisions, and stay in control. Using AI to write code you don’t understand just moves the problem one level up.