A4PythonBeginnerAbout 110 min to complete
Variables & Data Types
A correct mental model of how Python stores values — the foundation of every bug you will not write later.
Notebook
About 110 minutes to complete
Enrol to read the notebook and download it to run.
What this module covers
A correct mental model of how Python stores values — the foundation of every bug you will not write later.
By the end of it
- Describe Python's memory model: names are labels bound to objects, not boxes holding values
- Use id(), is, and == correctly, and explain precisely when they disagree
- Explain dynamic typing and its trade-offs against static typing
- Work confidently with Python's core types: int, float, bool, str, None, complex
- Convert between types safely, and predict when a conversion raises versus silently truncates
- Apply the truthiness rules, including the traps (bool("0"), bool([]), bool(0.0))
- Explain floating-point imprecision and choose decimal when money is involved
- Distinguish mutable from immutable types and predict the consequences