FizzBuzz with range
for i in range(1, 16):
word = ("Fizz" if i % 3 == 0 else "") + ("Buzz" if i % 5 == 0 else "")
print(word or i)
Write Python 3 and run it right here. Python runs inside your browser, so nothing you type is uploaded. The first run downloads the runtime.
Ready
# input() reads one line from the input box.
name = input("What is your name? ")
print(f"Hello, {name}!")
for i in range(1, 4):
print(i, "squared is", i * i)
Type the input before you run. Each input() call reads the next line.
Press Run or Ctrl+Enter to see the output here.Runs in your browser with Python 3.14 (Pyodide 314.0.8). Your code is not sent to a server.
Runtime: Python 3.14 (Pyodide 314.0.8)
Python runs through Pyodide 314.0.8, a build of CPython 3.14 for WebAssembly. The first time you run code the browser downloads the runtime — about 12 MB — from the jsDelivr CDN, and later visits load it from the browser cache. The standard library comes with it: math, random, datetime, collections, itertools, functools, json, re, dataclasses, typing and more. Errors are printed as a normal Python traceback that points at main.py.
Everything happens on your device. The code you write is never uploaded, logged or stored on a server. Each run stops after 10 seconds and keeps up to 100,000 characters of output, so an endless loop cannot freeze the page.
Packages from PyPI such as NumPy or pandas are not installed, and programs cannot open windows (tkinter, turtle) or reach files on your computer. Every run starts with fresh variables; modules you have imported stay cached for the next run so they load faster.
Open an example in the editor above, change it and run it. Opening an example does not run it.
for i in range(1, 16):
word = ("Fizz" if i % 3 == 0 else "") + ("Buzz" if i % 5 == 0 else "")
print(word or i)
numbers = [5, 3, 8, 1, 9, 2]
squares = [n * n for n in numbers]
evens = [n for n in numbers if n % 2 == 0]
print("squares:", squares)
print("evens:", evens)
print("sorted:", sorted(numbers, reverse=True))
print("max:", max(numbers), "sum:", sum(numbers))
import sys
from collections import Counter
text = sys.stdin.read().lower()
words = [w.strip(".,!?") for w in text.split()]
for word, count in Counter(words).most_common(3):
print(f"{word}: {count}")
Input
the cat and the dog. The end!
from dataclasses import dataclass, field
@dataclass
class Cart:
items: dict[str, float] = field(default_factory=dict)
def add(self, name: str, price: float) -> "Cart":
self.items[name] = price
return self
@property
def total(self) -> float:
return round(sum(self.items.values()), 2)
cart = Cart().add("tea", 3.5).add("cake", 4.25)
print(cart)
print("total:", cart.total)
def parse_age(text: str) -> int:
age = int(text)
if age < 0:
raise ValueError("age cannot be negative")
return age
for raw in ["42", "-1", "abc"]:
try:
print(raw, "->", parse_age(raw))
except ValueError as error:
print(raw, "-> error:", error)
Programs here do not stop and wait for you to type while they run. Everything your program reads comes from the input box, which you fill in before pressing Run.
input() reads the next line from the input box, and input("Prompt: ") prints the prompt first. sys.stdin.read() returns all of the input at once, and for line in sys.stdin loops over it line by line. When the input is used up, input() raises EOFError.
Your latest Python code and input are saved automatically in this browser, so they are still here when you come back. Nothing is saved on a server.
Share creates a link that carries your code inside the address itself, compressed after the # sign. Whoever opens it sees your code in the editor, and it only runs when they press Run.
| Keys | Action |
|---|---|
| Ctrl+Enter | Run the code |
| Ctrl+/ | Comment or uncomment the line |
| Tab · Shift+Tab | Indent or outdent the selection |
| Ctrl+F | Find and replace in the code |
| Ctrl+Z · Ctrl+Shift+Z | Undo / redo |
| Esc → Tab | Leave the editor with the keyboard |
On a Mac, use ⌘ instead of Ctrl.
Python 3.14, provided by Pyodide 314.0.8. The version is shown under the editor, and it only changes when this site is updated.
Not yet. Only the standard library is available, which covers most exercises, interview questions and scripts. There is no pip, so third-party packages cannot be installed.
Python itself has to be downloaded into your browser before the first run — about 12 MB. It starts loading as soon as you click into the editor, and once it is ready, runs take only as long as your code does.
Yes. There is no account, no sign-up and no daily limit. The only limit is that a single run stops after 10 seconds.
No. The Python runtime is downloaded into your browser and your code runs there, on your device. The site only serves the page and the runtime files; it never receives the code you write or the input you give it.
In this browser's local storage, one draft per language. It stays until you clear this site's data, and it is not synced to other devices. Use a share link to move code somewhere else.
Press Share and send the copied link. The code is compressed into the part of the link after #, which browsers never send to a server. Very long programs do not fit in a link, and the page will tell you when that happens.
Yes. It runs in any current mobile browser. On a slow connection the first run takes longer because the runtime has to be downloaded once.