🐍 Python Playground

Write, run, and learn Python right here in your browser — no installation needed

Login to Save Progress
Progress 0 / 0 done

Quick Reference

Output
printprint("Hello")
f-stringf"Value: {x}"
Variables
int/float/strx = 10
inputinput("Name: ")
Conditionals
if/elif/elseif x > 0:
Loops
for loopfor i in range(5):
while loopwhile x > 0:
Lists
create/index[1, 2, 3]
methods.append() .sort()
Functions
definedef func(arg):
Math
math moduleimport math
randomrandom.randint()
Strings
methods.upper() .split()
👋 Welcome to Python Playground

Choose an exercise on the left, or write your own code. Click ▶ Run to execute. Your code runs on the Afro-Merica server — same engine as the Python Kids Challenge.

  main.py
Ready
Output
>>> Ready. Press ▶ Run to execute your code.

Ctrl + Enter to run

What You'll Learn

Select an exercise to see learning goals.

Common Errors 🔍

IndentationError
Use 4 spaces inside loops/functions
NameError
Variable not defined yet
TypeError
Wrong type — use int() or str() to convert
SyntaxError
Missing colon : or mismatched brackets
IndexError
List index out of range

💡 Pro Tips

  • Use print() to debug
  • Add # comments to explain
  • Python is case-sensitive: Name ≠ name
  • Indentation = 4 spaces (not tab)
  • Click any snippet in Quick Reference to insert it