Python Practice

Practise Python Right in Your Browser

Write real Python, run it and get instant feedback, with nothing to install. The exercises follow Season 2 lesson by lesson, from your first line to handling bad data.

  • 10 exercises
  • Runs on your computer
  • No account needed

Exercises

Exercise 1 · Lesson 18

Your First Line of Python

Print exactly this sentence: Hello, AI world!

main.pyCtrl+Enter to run
Output
Press Run to see what your code prints.

Questions About Python Practice

Do I need to install Python?

No. Python runs inside your browser, on your own computer, thanks to Pyodide (the real CPython, compiled for the web). The first run downloads it once, about 12 MB; after that it starts in a second or two.

Is my code sent anywhere?

No. Your code runs and is checked in your browser. Your drafts and the exercises you solve are saved in this browser only, so they stay private and are not linked to your account.

Which lessons do the exercises follow?

They follow Season 2 of the curriculum, Python, lesson by lesson: your first script, variables, strings and f-strings, lists and dictionaries, loops, functions, files and errors. Each exercise only uses what its lesson and the lessons before it teach.

What if my code runs forever?

Press Stop. Your code runs separately from the page, so a loop that never ends cannot freeze the site, and it is stopped by itself after 15 seconds.

Never Miss a Lesson

Subscribe on YouTube, or get an email the day each new lesson goes live.