🐍 Python Playground
Write, run, and learn Python right here in your browser — no installation needed
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.
>>> Ready. Press ▶ Run to execute your code.
Ctrl + Enter to run
What You'll Learn
Select an exercise to see learning goals.
Common Errors 🔍
IndentationErrorUse 4 spaces inside loops/functions
NameErrorVariable not defined yet
TypeErrorWrong type — use int() or str() to convert
SyntaxErrorMissing colon : or mismatched brackets
IndexErrorList index out of range
💡 Pro Tips
- Use
print()to debug - Add
# commentsto explain - Python is case-sensitive:
Name ≠ name - Indentation = 4 spaces (not tab)
- Click any snippet in Quick Reference to insert it
