Learning objectives
By the end you can:
- Explain, in plain language, what a program is and what the Python interpreter actually does with your code (read it, translate it, and execute it one instruction at a time) and distinguish a statement (an instruction) from an expression (something that produces a value).
- Name Python's core built-in types (
int,float,str,bool, andNoneType) recognize a literal of each, and predict whattype(x)returns for any value you can construct. - Explain what a variable actually is in Python (a name bound to a value, not a labeled box that contains it), predict the effect of assignment and re-assignment, and trace multiple-assignment and swap idioms correctly.
- Evaluate arithmetic, comparison, and logical expressions by hand, including operator precedence, integer vs. true division (
//vs/), the modulo operator (%), and augmented assignment (+=and friends). - Build and reason about strings: concatenation, f-strings with format specifiers (
:.2fand friends), and the handful of string methods (.strip(),.split(),.upper()/.lower()) needed to clean and format real data. - Use a Python list as an ordered sequence of values well enough to index it (including negative indices), measure it with
len(), grow it with.append(), and iterate over it, while knowing this is a first taste, not the full picture (CS1.02 owns the deep list/tuple/dict/set comparison). - Write and trace control flow (
if/elif/elsefor decisions,whilefor open-ended repetition,forfor repetition over a known sequence) and correctly predict the output of nested and combined control-flow code. - Write functions: parameters, a
returnvalue, the difference betweenreturnandprint, and the basic scoping rule that a name assigned inside a function is local to it, and explain why breaking a program into small, well-named functions is not decoration but the single highest-leverage habit in this entire module. - Perform basic input/output: format and print numbers precisely with f-strings, read a value with
input(), and (critically) remember that everything read frominput()or a text file arrives as astrand must be deliberately converted before it can be used as a number. - Apply everything above to the module's running problem: given a list of daily closing prices from an Indian (₹, NSE-style) or US (\$, NYSE-style) snapshot, compute the price change, the total return, the count of up-days, the average daily change, and the best/worst single day, first by hand, then in real, running, tested Python (this module's code pack,
CS1.01). - (Productivity objective: R10 duality.) Use an AI coding assistant as a copilot for exactly the parts of this module you already understand by hand, scaffolding, boilerplate, explaining an unfamiliar error message, while never letting it write code whose logic you cannot personally verify, and while always running the tests yourself before trusting the result.
The duality, stated once (R10). Objectives 1–10 are the understanding objective: the gate (quiz ≥ 85%, code-pack ≥ 85% with hidden tests green) rewards being able to trace, write, and debug this code yourself, by hand and in the editor. Objective 11 is the productivity objective: knowing how a real developer uses an AI copilot on top of that understanding, never instead of it. A copilot can type faster than you. It cannot pass this module's hidden tests for you, because passing them requires code that is actually correct on inputs the copilot, and you: have never seen.
Prerequisites & connections
Builds on. Nothing. This is the first node of the quant-cs branch and, per the program's day-one entry rule, it unlocks from the very start, no finance-phase progress and no other branch is required. The only assumptions are comfort with ordinary arithmetic (addition, subtraction, multiplication, division, percentages) and the patience to be pedantic, because a computer executes exactly what you wrote, not what you meant. If you have never written a line of code before, you are exactly the intended reader.