FizzBuzz
The classic warm-up: a loop and if / elif.
for i in range(1, 16):
if i % 15 == 0:
print("FizzBuzz")
elif i % 3 == 0:
print("Fizz")
elif i % 5 == 0:
print("Buzz")
else:
print(i)Free, nothing to install, no sign-in. Run it, then watch it run: every variable, step by step.
Press play or drag the slider. What changed in a step lights up yellow; the step that fails is red. This is the real player, no sign-in.
As handy as VS Code on your computer, plus what it does not have: every step drawn.
Press Step and the code stops at each line: the lit line runs next, and every variable’s value sits beside it. Go back too, with the ← → keys.

Under the error, press “See how it went wrong”: the visualizer opens at the failing step, in red, with the reason in plain words. Step back through everything before it.

A link opens this very code. Or export a GIF of it running (light or dark, wide or tall) or a picture of the code, and post it to X, a chat, or embed it in a blog.

Each one can be stepped through and visualized. Change it, run it again.
The classic warm-up: a loop and if / elif.
for i in range(1, 16):
if i % 15 == 0:
print("FizzBuzz")
elif i % 3 == 0:
print("Fizz")
elif i % 5 == 0:
print("Buzz")
else:
print(i)A table of squares in one line, next to the loop it replaces.
squares = [n * n for n in range(6)]
print(squares)
evens = [n for n in squares if n % 2 == 0]
print(evens)
# the same, with a loop
loop = []
for n in range(6):
loop.append(n * n)
print(loop == squares)How many times each letter appears in a sentence.
text = "hello kodewick"
count = {}
for ch in text:
if ch != " ":
count[ch] = count.get(ch, 0) + 1
for ch, n in sorted(count.items()):
print(ch, n)Open it in the visualizer: the call stack grows, then unwinds.
def factorial(n):
if n <= 1:
return 1
return n * factorial(n - 1)
for i in range(1, 6):
print(i, factorial(i))Why the same number is never worked out twice.
memo = {}
def fib(n):
if n in memo:
return memo[n]
if n < 2:
return n
memo[n] = fib(n - 1) + fib(n - 2)
return memo[n]
print([fib(i) for i in range(10)])The range halves each step: step through it and watch lo and hi.
def search(xs, x):
lo, hi = 0, len(xs) - 1
while lo <= hi:
mid = (lo + hi) // 2
if xs[mid] == x:
return mid
if xs[mid] < x:
lo = mid + 1
else:
hi = mid - 1
return -1
print(search([2, 5, 8, 12, 16, 23, 38], 16))Switch the list to bars and watch neighbours swap.
xs = [5, 2, 9, 1, 7]
for i in range(len(xs)):
for j in range(len(xs) - 1 - i):
if xs[j] > xs[j + 1]:
xs[j], xs[j + 1] = xs[j + 1], xs[j]
print(xs)Who self is, plain to see in the visualizer.
class Dog:
def __init__(self, name):
self.name = name
self.tricks = []
def learn(self, trick):
self.tricks.append(trick)
rex = Dog("Rex")
rex.learn("sit")
rex.learn("roll over")
print(rex.name, rex.tricks)Nodes and arrows, drawn in a row.
class Node:
def __init__(self, val, next=None):
self.val = val
self.next = next
head = None
for v in [3, 2, 1]:
head = Node(v, head)
node = head
while node:
print(node.val)
node = node.nexttry / except: something goes wrong, the program carries on.
for d in [2, 0, 5]:
try:
print(10 / d)
except ZeroDivisionError:
print("cannot divide by zero")input() waits; answer it right in the output panel.
name = input("What is your name? ")
age = int(input("How old are you? "))
print(name, "will be", age + 1, "next year")turtle draws right in the browser.
import turtle
t = turtle.Turtle()
for _ in range(5):
t.forward(100)
t.right(144)No and no. Open the page and write; your code stays in your own browser, nothing is uploaded.
Yes. Tap the code to write full screen, with a key row for Tab, brackets and colons; the output slides up from below.
When it reaches input(), a box appears in the output: type the answer, press Enter, and it carries on.
The language and its error messages are the same. You cannot install packages or read your files, which is plenty for learning, exercises and algorithms.
Every variable, every call frame, and arrows between lists, dicts and objects. Linked lists, trees and grids are drawn by their shape; a list of numbers can be shown as bars.
Under the error, press "See how it went wrong": the visualizer opens at the failing step, in red, and you can step back to see how it got there.
In this browser: My code keeps every file. Clearing the browser’s data removes it, so share anything important as a link.
Share → Copy link: whoever opens it gets the same code, no sign-in. You can also export a GIF of it running, or a picture of the code, and post it to X.