No var, no let, no semicolons. Dynamic typing with optional type hints. ~15 min
Lesson notes
Python is dynamically typed: a name points at an object, and the object carries the type. You don't declare variables — you just assign. Blocks are defined by indentation (4 spaces by convention), not braces.
Coming from Dart
Dart
final name = 'Ada';
var age = 36;
print('$name is $age');
Python
name = "Ada"
age = 36
print(f"{name} is {age}")
f-strings are Python's string interpolation. Anything inside {} is an expression: f"{age * 2}" works.
Core types: int (arbitrary precision — no overflow!), float, bool (True/False, capitalised), str, and None (Python's null). Use type(x) to inspect and isinstance(x, int) to check.
Write greet(name, score) that returns the string "Hi <name>, you scored <score>%" where score is shown with exactly one decimal place. Example: greet("Ada", 92.456) → "Hi Ada, you scored 92.5%".
Ctrl/⌘ + Enter runs the tests · Esc then Tab leaves the editor