Examples
Python programs you can actually run.
Twelve short examples covering the basics, input, functions, data, and charts. Open one in the compiler, change it, and see what happens.
Showing all 12 examples
Hello, world!
Your first Python program, plus variables and f-strings.
Add two numbers with input()
Read values with input() and convert them to numbers.
FizzBuzz
A classic loop exercise with if, elif, and the modulo operator.
Fibonacci sequence
Generate a sequence with a while loop and a helper function.
Temperature converter
Convert Celsius to Fahrenheit and back with formatted output.
List statistics
Find the minimum, maximum, mean, and median without extra packages.
Word counter
Use a dictionary to count how often each word appears.
A small class
Build a class with methods, state, and a safe withdrawal check.
NumPy statistics
Load NumPy on demand and compute statistics on an array.
Pandas table
Create a DataFrame, filter rows, and calculate a summary.
Matplotlib chart
Plot a sine wave and see the chart appear in the Plots tab.
Friendly error handling
Catch a division-by-zero error and keep the program running.
Want to write your own?
The compiler opens with starter code and saves your work automatically.