Loading…

Online Python Playground

Write Python and run it instantly. The output appears in a console below the editor, just like running a script on your own computer.

It is useful for learning Python, trying out a small piece of logic, or checking how a built-in function behaves — without installing Python first.

Things to try

  • Print some text and do a few calculations.
  • Write a for loop and a while loop.
  • Create a list and a dictionary, then loop over them.
  • Define a function and call it with different values.
  • Import a standard-library module such as math, json or datetime.

How it works

The playground uses Pyodide, which is the real CPython interpreter compiled to WebAssembly. Python is downloaded once and then runs on your computer, in a background worker, so a long-running script does not freeze the page.

Python's standard library is available. Extra packages from PyPI are not installed in this playground, so it is best for learning the language itself and testing plain Python code.

Frequently asked questions

Which version of Python does this use?

It runs CPython through Pyodide, so it behaves like normal Python 3. The standard library is included.

Can I install packages like NumPy or requests?

Not in this playground. It is set up for the Python language and its standard library only.

Does my code run on your server?

No. Python runs inside your own browser. Your code is not uploaded anywhere.

Why is the first run slower?

The first time you press Run, your browser downloads the Python runtime. After that, runs start much faster.