LabPython Playground

Python Playground

Fix a small Python puzzle or write your own code. Run it in your browser and see the output.

Runs in your browser

PYTHON / LEARN BY TRYING

Change the code, see what happens

Start with a small bug. Edit the Python, run it, and use the results to work out what to try next.

Python 3
YOUR TASK

Fix the positive-number filter

This function should add only numbers greater than zero. Find the incorrect condition, change it, and run the code to check your fix.

main.pyEDITABLE CODE

Use four spaces to indent. Ctrl+Enter or ⌘+Enter runs the code.

OUTPUTReady to run
Press Run Python to execute your code.

The first run loads Python into this tab.

For the starting example, a correct function should print 13.

Check the behaviour

Run the code to check 4 examples, including an empty list.

    Your code runs in this tab and is not uploadedPython loads on your first run

    Your input stays in this tab. These tools do not upload, store, or send it to an AI service.

    Try “PostgreSQL”, “Blinkr”, or “JSON”.