Python online compiler

Python 3 (Pyodide), with the standard library. Runs in your browser.

Learn Python →
main.py
# Online Python compiler
# Write Python 3 code here and press Run (or Ctrl/⌘ + Enter).

def greet(name):
    return f"Hello, {name}!"

print(greet("World"))

squares = [n * n for n in range(1, 6)]
print("Squares:", squares)

scores = {"Asha": 91, "Rahul": 78, "Priya": 85}
best = max(scores, key=scores.get)
print(f"Top scorer: {best} with {scores[best]}")
Output

Press ▶ Run or Ctrl/⌘ + Enter to run your code.