Skip to content
Real Python · pandas · numpy · matplotlib

Python Practice

A real CPython interpreter runs in your browser via Pyodide. Pandas, NumPy, and matplotlib are pre-loaded. Three Kenyan datasets are pre-defined as DataFrames so you can practice on real data from the moment you start.

Difficulty up to
0/43 done · 0%

The interactive REPL, basic types, the four operators, and why dynamic typing both helps and hurts.

Python is interactive: you type an expression and the REPL prints its value. print(x) writes to standard output. Without print, only the last bare expression in a cell is echoed (notebook-style); in script mode you must print explicitly.

Five built-in types you'll touch in your first hour: int, float, str, bool, None. Conversion is explicit: int("3") gives 3. Types are inferred but not lost — type(x) always tells you what something is.

Variables are names bound to values. x = 5 does not declare a type. The same name can later be bound to a string. This flexibility is also Python's main source of bugs: a typo in a variable name silently creates a new variable.

Chapter 1 · Exercise 1Easy

Hello, world

Print the string `Hello, Kenya` (exact text).

main.pypandas · numpy · matplotlib · bankrates, pension, mpesa pre-loaded

Powered by Pyodide — CPython compiled to WebAssembly. All execution happens in your browser.