🐍
Python Playground
Run Python code in your browser
▶ Run Code
Reset
Examples:
Basic
Lists
Functions
Dictionary
Math
Python Code
Python 3.11
# Python Playground # Write Python code and see the output! def greet(name): return f"Hello, {name}!" # Variables and basic operations numbers = [1, 2, 3, 4, 5] squared = [n**2 for n in numbers] print(greet("World")) print(f"Numbers: {numbers}") print(f"Squared: {squared}") # Try importing libraries import math print(f"Pi: {math.pi:.4f}") print(f"Square root of 16: {math.sqrt(16)}") # Dictionary example person = { "name": "Alice", "age": 25, "city": "New York" } for key, value in person.items(): print(f"{key}: {value}")
💡 Tip: Press Ctrl+Enter (Cmd+Enter) to run
📚 Supports: math, random, datetime modules
Console Output
⏳ Loading Python environment... This may take a few seconds.