← Introduction to Computer Science outline
Week 16 · Study guide
Week 16 — Final Study Guide (Cumulative, Weeks 1–15)
Course: Introduction to Computer Science — CS1 / Programming Fundamentals in Python (CSCI 1101) · Silver Oak University (fictional sample) · Prof. Okafor
Use this with: the Review Deck (E), the Exam-Prep Tutorial (N), and the Practice Final (O). The Final covers all 8 objectives.
For every fact below: if there's code, predict the output, then run it. The Final is mostly predict-the-output and debugging.
Coverage (and the point split)
| Objective | Topic | ~Items |
|---|---|---|
| 1 | Computing, print, errors |
3 |
| 2 | Variables, types, expressions, I/O, strings | 4 |
| 3 | Booleans & conditionals | 3 |
| 4 | while & for loops |
3 |
| 5 | Functions | 3 |
| 6 | Lists, tuples, dicts, sets | 3 |
| 7 | Strings, files & exceptions | 3 |
| 8 | Algorithms, recursion & OOP | 3 |
Objectives 1–2 — Basics, variables, expressions, strings
- Precedence (
*,/,//,%before+,-):3 + 4 * 2→11.SyntaxErrorvsNameError. /→ float (8 / 4→2.0);//floors;%remainder (13 % 4→1).int("7")+3→10;"3"+"4"→34.input()→ string. Slicing exclusive stop:"COMPUTER"[0:4]→COMP. f-strings insert values.
Objective 3 — Booleans & conditionals
and/or/not;not (5 < 3)→True.if/elif/elseruns the first true branch.=assigns,==compares.
Objective 4 — Loops
whileneeds a counter update.rangestop is exclusive:list(range(2, 8, 2))→[2, 4, 6].foraccumulatorrange(1,5)→10. Nested loops multiply.
Objective 5 — Functions
def f(a, b): return a + b. Noreturn→None. Local variables don't exist outside the function (NameError).
Objective 6 — Collections
- Lists are mutable;
.append()adds to the end. Aliasing:b = apoints at the SAME list (a = [1,2]; b = a; b.append(3)→ais[1, 2, 3]). Dicts:d[key]lookup; missing key →KeyError. Sets dedup (len({1,2,2,3,3,3})→3). Tuples are immutable (TypeError).
Objective 7 — Strings, files & exceptions
- String methods return NEW strings (immutable):
"hello".upper()→HELLO..split(",")→ list.with open(...)for files;try/except.int("x")→ValueError; missing key →KeyError; missing file →FileNotFoundError.
Objective 8 — Algorithms, recursion & OOP
- Big-O: linear
O(n), binaryO(log n)(needs sorted), selection sortO(n²). Recursion: base case + recursive case;fact(4)→24; no base case →RecursionError. OOP:class,__init__,self.attr, methods;Dog('Rex').speak()→Rex barks; forgettingself.→AttributeError.
The classic-bug checklist (memorize)
= vs == · exclusive range stop · / → float (5.0) · "2"+"3" is "23" · no return → None · list aliasing (b = a) · missing self. → AttributeError · binary search needs sorted · every recursion needs a base case · input() returns a string.
Self-check (✓ when you can do it without notes)
- [ ] Predict outputs across precedence, slicing, loops, and functions.
- [ ] Predict a list-aliasing result and a dict/set result.
- [ ] Trace a
try/except(which block runs). - [ ] Predict a recursive call's output and a class method's output.
- [ ] Name the Big-O of linear search, binary search, and selection sort.
- [ ] Take the Practice Final (O) and score yourself.
~ Prof. Okafor's edition · Fall 2026 · built with thecoursemaker.com