Write Python. Understand every error.

Starting Python in your browser…

Learn Python by fixing errors

Py-CRAFT is a free Python playground and course that runs entirely in your browser. Write code, press Run, and when something goes wrong you see which line caused it, why Python complains, and how to fix it.

Start with About Python, build a mini-project, test yourself with timed practice, or use the editor below for free practice. Step through shows your program running one line at a time.

Ctrl + Enter to run
Line 1, column 1Tab indents 4 spaces. Press Esc then Tab to leave the editor.

What is Py-CRAFT?

Py-CRAFT is a free Python course and practice editor that runs entirely in your web browser. There is nothing to install: you read a short lesson, write real Python, press Run, and see the result at once. When a program goes wrong, Py-CRAFT does not leave you with a puzzling error message. It shows which line caused the problem, explains in plain words why Python complains, and shows how to fix it, often with a one-click repair.

Who it is for

Py-CRAFT is written for school leavers and first-year college students who are new to programming, and for anyone teaching themselves Python. It assumes no earlier experience. Teachers can use it in a lab or a classroom because it works in any modern browser, on a low-cost laptop or a phone, without any set-up.

How it works

  1. Pick a topic and read the short lesson. Every lesson ends with key takeaways and the mistakes beginners make most often.
  2. Try it. Open an example in the editor, change it, and press Run. Step through shows your program one line at a time, with every variable.
  3. Read the explanation when something goes wrong. Each error is explained with the line, the reason, and a corrected version.
  4. Practise. Exercises are checked automatically on several inputs, quizzes test your understanding, and mini-projects put topics together.

All topics

Python basics

NumPy

Fun with Python

Mini-projects

Popular guides

Error guides

Programs

Quick references

The error guide explains the errors beginners meet most often, and the cheat sheets are printable one-page summaries. Every example in them shows real output.

Portrait of Dr. Saptarshi Das

Course by Dr. Saptarshi Das, Kolkata. How the content is checked.