A · Setup · beginner · Week 1–2 · Chapter 3 of 13
Syntax, types & control flow
Indentation, variables, strings, f-strings, if/for, lists, dicts. Enough to read test code and write helpers.
Path progress18%
Step 1 of 3
Variables and f-strings
Dynamic typing — types exist at runtime. f-strings are the readable default for formatting.
Example
username = "standard_user"
password = "secret_sauce"
print(f"Attempting login for {username}")Do this now
Script that stores username/password and prints formatted login attempt.
Was this step clear?
Chapter learning outcomes
- Indentation rules
- f-strings
- if/elif/else
- for loops
- lists and dicts
Clear these before you leave
Side quest
Password validator
Function is_valid_password(s) → bool with length and empty checks.