Affiliate disclosure

Book titles on this page link to Amazon. As an Amazon Associate, DataField.Dev earns from qualifying purchases — at no additional cost to you.

Further Reading: Variables, Types, and Expressions

Python's Object Model and Memory

  • Ned Batchelder (2015). "Facts and Myths about Python Names and Values." PyCon talk. (Tier 1) The definitive talk on how Python variables actually work. Batchelder explains the name tag model with animations and clear examples. Available as a video on YouTube and as a blog post. If you watch one external resource from this chapter, make it this one.

  • Python Documentation: "Data Model." (Tier 1) The official reference for how Python objects work internally. Heavy reading for a beginner, but bookmarking it now means you'll have it when you're ready. Focus on the "Objects, values and types" section. Available at docs.python.org/3/reference/datamodel.html.

Python Types and Expressions

  • Downey, A. Think Python, 3rd Edition, Chapters 1-2. (Tier 1) Another open-source textbook's take on variables, expressions, and types. More concise than this chapter, good for a second perspective. Available free online.

  • Sweigart, A. Automate the Boring Stuff with Python, Chapter 1. (Tier 1) A practical introduction to Python basics with a focus on getting useful things done quickly. The first chapter covers the same ground as this one but with different examples. Available free online.

  • Python Documentation: "Built-in Types." (Tier 1) The comprehensive reference for int, float, str, bool, and every other built-in type. You don't need to read it all now, but it's the authoritative source when you have questions. Available at docs.python.org/3/library/stdtypes.html.

f-Strings and String Formatting

  • Python Documentation: "Format Specification Mini-Language." (Tier 1) The complete reference for format specifiers (the part after the colon in f-strings). Covers every option including fill characters, sign handling, and type codes. Available at docs.python.org/3/library/string.html#formatspec.

  • Real Python: "Python's F-String for String Interpolation and Formatting." (Tier 2) A thorough tutorial with examples covering basic usage through advanced features like debugging with = (e.g., f"{variable=}" in Python 3.8+). Good for practice beyond what this chapter covers.

Floating-Point Arithmetic

  • Goldberg, D. (1991). "What Every Computer Scientist Should Know About Floating-Point Arithmetic." ACM Computing Surveys, 23(1), 5-48. (Tier 1) The classic paper on why 0.1 + 0.2 != 0.3. Very technical, but the introduction is accessible and eye-opening. You'll appreciate this more after taking a computer organization course, but skimming it now builds awareness.

  • Python Documentation: "Floating Point Arithmetic: Issues and Limitations." (Tier 1) Python's own explanation of why floats behave surprisingly. Much more accessible than Goldberg's paper. Available at docs.python.org/3/tutorial/floatingpoint.html.

Software Failures and Variable Naming

  • Mehta, N. and Ozick, D. "Knightmare: A DevOps Cautionary Tale." (2014). (Tier 2) A detailed post-mortem of the Knight Capital trading disaster referenced in Case Study 2. Examines the deployment practices and code management failures that led to the $440 million loss. Search for "Knight Capital Group trading glitch" for SEC filings and news coverage.

  • NASA Mars Climate Orbiter Mishap Investigation Board, Phase I Report (1999). (Tier 1) The official NASA report on the loss of the Mars Climate Orbiter due to a unit conversion error. Dry but fascinating reading about how a seemingly simple mistake (imperial vs. metric) can destroy a $125 million spacecraft. Available through NASA's technical reports server.

PEP 8 and Naming Conventions

  • van Rossum, G., Warsaw, B., and Coghlan, A. "PEP 8 — Style Guide for Python Code." (Tier 1) The official Python style guide. Covers naming conventions, indentation, line length, and more. You don't need to memorize it, but read the naming conventions section now and bookmark the rest. Available at peps.python.org/pep-0008/.

For the Curious

  • Python Tutor (pythontutor.com) (Tier 2) An online tool that visualizes Python code execution step by step, showing exactly how variables point to objects in memory. Paste any code from this chapter into it to see the name tag model in action. Extremely useful for building intuition.

  • Luciano, R. Fluent Python, 2nd Edition, Chapter 6: "Object References, Mutability, and Recycling." (Tier 1) An advanced treatment of Python's object model — where the name tag model from this chapter leads when you follow it to its logical conclusions. Wait until you've completed Chapters 8 and 14 before tackling this, but know it's there for when you're ready.