DP Computer Science · Practical lab

Python playground

Predict. Run. Change something. Explain what happened.

Your code stays on this browser.
main.pyShift + Enter to run
OutputStarting editor…
Press Run Python to start.
Program input For code that uses input()

If you run out of answers, Python reports an EOFError. Add the missing lines and run again.

Python runs on your device. The first run downloads about 14 MB from this site. Programs stop automatically after 30 seconds; Stop keeps your code. Variables start fresh on each run.

What can I use?

Python’s core language and standard library: lists, dictionaries, functions, classes, math, random and text-file experiments. Files live in temporary browser memory and are cleared when Python restarts or you leave the page. Desktop windows, turtle graphics, pip installs and third-party packages are not included in this playground.

Code is saved locally on this browser when storage is available. Use Download .py to keep a copy for class. Loading an example replaces the editor after confirmation. In the editor, press Escape then Tab to move keyboard focus out.

Powered by Pyodide and CodeMirror.