- escape sequence E11
- A backslash plus a special character inside a string literal. Tells Python the next character is not what it looks like — interpret it specially. Examples: \" (literal quote), \n (newline), \t (tab), \\ (literal backslash).
- escape character E11
- The backslash (\) itself. The signal that escapes the next character. Distinct from an escape sequence, which is the backslash plus its payload.
- f-string (formatted string literal) E11
- A string prefixed with f that lets you embed variables directly using {}. The f is a string TYPE marker — like b"..." for bytes or r"..." for raw — not a function call. Variables in {} get interpolated with their actual values at runtime.
- interpolation E11
- Replacing {variable} with the actual value of variable at runtime. The mechanism that f-strings use to fill in placeholders.
- function E1+
- An action the language knows how to do. Called with parentheses, can take arguments, may return a value. Example: print("hello") calls the print function with the argument "hello".
- argument E5+
- The value you pass into a function when you call it. Flows IN. Influences function behavior. Example: in print("hi"), the string "hi" is the argument.
- parameter E10
- The placeholder name in a function definition that receives an argument. Distinct from argument: parameter is def-side (the slot), argument is call-side (the value you pass in).
- named parameter E10
- Call-time syntax for passing an argument by parameter name rather than position. Example: print("hi", end="") — end is the parameter name spelled out at call time.
- default value E10
- A def-time property attached to a parameter, used only when the caller skips that argument. Example: def hello(to="world") — "world" is the default for parameter to.
- return value E5+
- A value a function hands BACK to whoever called it. Flows OUT. Distinct from side effect (visible action). Example: input() has both a side effect (showing prompt) AND a return value (the typed string).
- side effect E6
- A visible action a function performs that is NOT its return value. Example: print() shows text on the screen — that's the side effect. The return value is None.
- variable E5+
- A labeled named storage location. Created with assignment: name = value. Accessed by name: print(name). Different from a string with the same characters: "name" is literal text, name is the variable.
- assignment operator (=) E7
- Single equals sign. Right-to-left copy. Stores the value on the right into the variable on the left. NOT equality (which is ==).
- literal (the noun) E12
- A value written directly in source code, not computed at runtime. 5 is an integer literal; "hello" is a string literal; [1,2,3] is a list literal; f"hello" is a formatted string literal. The programming term 'literal' (noun) is distinct from the everyday adverb 'literally' — same root, different meanings.
- string immutability E12
- Once a string is created it cannot be modified in place. Methods like .lower(), .upper(), .strip() return NEW strings; the original is unchanged. To 'change' a variable's value, you must reassign: name = name.lower(). Tuples, integers, floats, frozensets, and booleans are also immutable. Lists, dicts, and sets are mutable.
- string method E12
- A function attached to a string object, called with dot syntax: name.lower(), s.split(), text.strip(). Most string methods return a NEW string (because strings are immutable) rather than modifying the original. The original variable stays unchanged unless you reassign.
- NameError E12
- Python's error when you reference a variable, function, or name that hasn't been defined. The interpreter looked it up, didn't find it, reported the gap. Useful diagnostic — means 'you asked for a thing that doesn't exist.' Fix: define the name first, or check spelling.
- SyntaxError E12
- Python's error when the parser can't make sense of the code structure — missing quote, missing parenthesis, malformed statement. Fires before the code runs at all (different from runtime errors). Python 3.14 ships tutor-grade hints in many SyntaxErrors ("unterminated string literal", "Did you mean ==?").
- AttributeError E12
- Python's error when you call a method or access a property that doesn't exist on the object's type. Example: "hello".lowe() throws AttributeError because str has no .lowe() method (typo for .lower()). Python 3.14 often suggests the correct attribute in the error message ("Did you mean: 'lower'?").
- PEP 8 E15
- Python Enhancement Proposal #8 — the community style document for Python code. Specifies snake_case naming, one space around binary operators, lines under 79 chars, and other conventions. NOT enforced by the Python interpreter (which runs styled and unstyled code identically). Enforcement happens via tools (linters like pylint and flake8 flag violations; formatters like black auto-rewrite to comply) and humans (code review).
- true division (/) E15
- The forward-slash operator. In Python 3, always returns a float, even when both operands are integers and divide cleanly. 8/4 returns 2.0, not 2. For an integer result that drops the remainder, use floor division (//) instead.
- input() E16
- Built-in I/O function that displays an optional prompt, pauses program execution, captures the user's keystrokes until they press Enter, and returns those captured characters as a string. The key word is ALWAYS — even when the user types digits, input() returns text, not numbers. The string-ness doesn't come from quotes; it comes from input()'s design.
- int() E16
- Built-in function that converts a value to an integer. Most common use: int(input(...)) — wraps an input() call to turn the user's typed digits from a string into an actual number. Inner function (input) runs first and returns a string; outer function (int) runs second and converts. Nested evaluation: innermost first, like brackets in math.
- concatenation E16
- What the + operator does between two strings: glues them end-to-end. "1" + "2" returns "12", not 3. The type of the operands controls what + does — strings concatenate, integers add mathematically. Same symbol, different operation.
- TypeError E16
- Python's error when an operator can't combine the types it's given. Example: 5 + "3" raises TypeError: unsupported operand type(s) for +: 'int' and 'str'. The error message names the two types it couldn't combine — the rule whispered back at you. Read the types in the error; they tell you what's actually in your variables.
- Shell vs Python distinction E17
- PowerShell and the Python REPL both wait for typed input, but they parse different command grammars. PowerShell expects cmdlets (Get-ChildItem, cd). Python REPL expects Python syntax (print(), x = 5). Same keyboard, different language. Wrong-grammar input often fails at execute-time with a NameError because Python successfully parses the line (e.g. Get-ChildItem reads as 'Get minus ChildItem') but can't resolve the name.
- conditional statement E17
- Code that picks ONE path to take, out of several possible paths. Each path has a yes/no question attached; the path runs only when its question evaluates to True. The if / elif / else family forms the standard branching structure. Mutual exclusion: once one path fires, the rest are skipped — even if their questions would also be true.
- .replace(old, new) E22
- String method that returns a NEW string with every occurrence of old swapped for new. Takes two arguments — what to find, what to put in its place — both strings. Example: "a b c".replace(" ", "...") returns "a...b...c". Like every string method it leaves the original untouched (strings are immutable) and hands back a copy. Used in CS50P Playback to turn spaces into ellipses.
- nesting (order of operations) E22
- When one call sits inside another, the INNERMOST runs first and its result flows outward. print(name.replace(" ", "...")) runs .replace on name first, producing the transformed text, THEN print shows it. Cook-before-serve: the transformation has to finish before the outer call can act on the result. Read a nested line from the inside out.