1. Variables store values
In price = 12, the name price refers to the number 12. Try the “Numbers & variables” example, change the quantity, and predict the new total before running it.
Try an example, change the code, and run it right here.
Your output will appear here.
Change one line at a time, then run your program to see the result. These examples help you connect each Python idea to its output.
In price = 12, the name price refers to the number 12. Try the “Numbers & variables” example, change the quantity, and predict the new total before running it.
input() reads one line from Program input. If you need a number for arithmetic, convert it with int(). Enter 75 in the “Make a choice” example, then try 40.
The “A counting loop” example uses range(1, 6) to produce 1 through 5. Change 6 to 4 and compare the output. Python uses indentation to decide which lines belong to the loop.
Press Debug to run your code and step through executed lines. Inspect variable values before each line runs. The debugger is designed for small beginner programs and stops recording after 200 steps.
Catnip Compiler is a practice space for people learning Python. It runs code in your browser, so you can experiment with variables, input, decisions, and loops without installing Python. “Generate starter” inserts a selected example template; it does not use AI. Java support is planned for a later version.
Your code runs on your device. It is not saved to an account. Shared links contain the code in the link itself: anyone with the link can read it. Avoid putting passwords or private information in your programs. The first run may take a moment while Python loads.