Pack B: College Semester Pack
The extra topics first-year university syllabi add: recursion, searching and sorting, file automation, regex and a mini game.
- Recursion: Recursion = a base case answered directly + a call on a smaller problem; always return the recursive call; memoise repeated work (@lrucache).
- Searching and sorting: Linear search works anywhere (O(n)); binary search needs sorted data (O(log n)); bubble swaps neighbours, selection picks the minimum, insertion slides each item into place (all O(n²)).
- Automating files: os.listdir gives names (join them back with os.path.join); os.walk visits the whole tree; shutil.copy/move and os.makedirs(existok=True) organise; zipfile backs up; deleting is permanent.
- Regular expressions: Write regex as r"..."; search finds anywhere, fullmatch validates the whole text, findall lists all (tuples with groups), sub replaces (\1 reuses a group).
- Mini game: a campus adventure: A game is a while loop over (show, read, update); keep the world in dicts, clean input with .strip().lower(), seed random, and print exact messages so it is testable.
Ends with a 13-question checkpoint (80% passes) and a mini project: Student records toolkit (lab exam).