How to use the Python Online Compiler
- 1. Write your codeType or paste a Python 3 program into the editor.
- 2. Add input linesPut one line in the Input box for each input() your code calls.
- 3. Run itSee printed output and any traceback with the correct line numbers.
How it runs real Python in a web page
This compiler uses Pyodide, the official CPython interpreter compiled to WebAssembly. It is the same Python language you install on a laptop, version 3.12, running inside your browser in a background worker. The engine (about 10 MB) is downloaded once from the public jsDelivr CDN and then cached by your browser. Your code never leaves your device.
Because programs run in a separate worker, an accidental while True: cannot freeze the page. When the time limit runs out, the worker is stopped and a fresh Python is loaded on the next run.
Worked example and input() tips
The starter program asks for a name, builds a list of squares and adds them up. With Asha in the Input box, it prints:
Your name: Hello, Asha
Squares: [1, 4, 9, 16, 25]
Sum: 55The sum is 1 + 4 + 9 + 16 + 25 = 55. Note that the prompt text "Your name: " is printed, but the typed value is not echoed, the same as when input is piped into Python on a computer.
- Each
input()call reads the next line of the Input box. - If the program asks for more lines than you gave, you get a clear EOFError message.
- Use
int(input())orlist(map(int, input().split()))for numbers, exactly as in coding tests.
The standard library works (math, random, datetime, collections, itertools, json, re). Packages bundled with Pyodide, such as numpy and pandas, download on first import; files on your computer and network calls are not available.
Frequently asked questions
Is this real Python or a simulator?
Real. Pyodide is CPython compiled to WebAssembly, so results match normal Python 3.12.
Why is the first run slow?
The browser downloads the Python engine the first time, about 10 MB. Later runs on the same visit start almost instantly.
Can I install packages with pip?
Not directly. Packages that Pyodide ships, like numpy and pandas, load automatically when you import them. Others are not available here.
Is the Python compiler free?
Yes, free to use. Writing code needs no form. The first Run asks for your name and WhatsApp number once, then every Uncodemy tool runs without the form.