Write, run, and experiment with Python code directly in your browser. No installation required — powered by Pyodide.
Click the copy icon to paste code into the terminal
Start with the classic first program
print("Hello, PyMastery!")
print("Welcome to interactive Python learning!")Learn variables and string formatting
# Variables and calculations
name = "Python Learner"
age = 25
years_coding = 2
print(f"Hello {name}!")
print(f"You are {age} years old")
print(f"In 5 years, you'll be {age + 5}")
print(f"You've been coding for {years_coding} years")Explore lists and iteration
# Working with lists
languages = ["Python", "JavaScript", "Java", "C++"]
print("Programming languages:")
for i, lang in enumerate(languages, 1):
print(f"{i}. {lang}")
# List comprehension
lengths = [len(lang) for lang in languages]
print(f"\nLanguage lengths: {lengths}")Create and use functions
def greet(name, language="Python"):
"""Greet a programmer"""
return f"Hello {name}! Ready to learn {language}?"
def calculate_area(length, width):
"""Calculate rectangle area"""
return length * width
# Test the functions
message = greet("PyMastery Student")
print(message)
area = calculate_area(10, 5)
print(f"Rectangle area: {area} square units")Use Ctrl+Enter to run code quickly
Use Tab for indentation
Multi-line code is fully supported
Output appears below your code instantly
Complete Python 3 environment with standard library support
Run code immediately without any setup or installation
Practice with real code examples and see results instantly