Python Playground
Write and execute Python code directly in your browser
Code Editor
# Welcome to Python Playground! # Try running this example code def factorial(n): if n == 0: return 1 else: return n * factorial(n-1) print("Factorial of 5 is:", factorial(5)) # Calculate Fibonacci sequence def fibonacci(n): a, b = 0, 1 for i in range(n): print(a, end=' ') a, b = b, a + b print("Fibonacci sequence:") fibonacci(10)
Output
Output will be displayed here...
Run Code
Clear Output
Load Example
Initializing Python environment...
Quick Examples:
Hello World
Math Operations
Loops
List Operations