Fall 2026 · Wolfcode
Computer Science I.
An introduction to programming using Python.
Topics covered include basic program design; program flow including decisions, functions, and loops; command-line and file input/output; variables and types; and string and sequence processing.
Course outline
Variables & Types
变量与类型
Name a value once, reuse it many times. Learn the three core types of CSC 141 — int, float, str — and how Python keeps them straight.
Conditionals
条件分支
Make decisions: if / elif / else, comparison and logical operators, and the order-of-branches trap. Strictly aligned with Think Python §5.1–§5.6.
Loops
循环
Do something many times. for / range, while, break — and the four patterns (accumulator, counter, tracking variable, while-true) that cover 95% of beginner loops. Strictly aligned with Think Python §7.1–§7.4.
Functions
函数
Name a group of statements, eliminate repetition, debug the parts one at a time. def / return / parameters / default args / composition. Strictly aligned with Think Python §3.4–§3.11 and Chapter 6.
Lists
列表
The universal container for sequences of values. Create, index, slice, mutate — and the copy-first idiom that saves you from aliasing bugs. List comprehensions compress map+filter into one line. Strictly aligned with Think Python §10.1–§10.12.
- 05.01Walkthrough: List Basics例题: 列表入门python-lists 8m
- 05.02List Basics列表入门python-lists python-loops 15m
- 05.03List Comprehension列表推导式python-lists python-loops 20m
- 05.04List Methods列表方法python-lists 20m
- 05.05Homework: Student Grade Report作业: 学生成绩报告python-lists python-functions python-loops 45m
String Algorithms
字符串算法
Treat strings as collections of characters. Index, slice, traverse, search, count. .split() / .join() / .strip() / [::-1] — the methods you reach for daily. Strictly aligned with Think Python §8.1–§8.10.
- 06.01Walkthrough: Count Vowels例题: 数元音字母python-strings python-loops 8m
- 06.02Word Count单词计数python-strings 15m
- 06.03Palindrome Check回文判断python-strings 20m
- 06.04Find First Match找首个匹配python-strings python-loops 20m
- 06.05Homework: Text Statistics作业: 文本统计python-strings python-functions python-lists 45m
File I/O
文件输入输出
Persistence. open() / with / read / write / append. The shape of every batch data job: read, process, write. Strictly aligned with Automate the Boring Stuff with Python chapter 9.
- 07.01Walkthrough: Write Then Read例题: 写入再读取python-file-io 8m
- 07.02Read CSV-Lite读 CSV 文件python-file-io python-strings python-lists 20m
- 07.03Append a Log追加日志python-file-io 20m
- 07.04Count Lines数行python-file-io python-loops 15m
- 07.05Homework: Word-Frequency Report作业: 词频报告python-file-io python-strings python-lists 45m
Command-Line Interface
命令行接口
Scripts become tools. sys.argv for the raw approach, argparse for proper ones — with --help, type validation, defaults, and exit codes for free. Build a Unix wc clone.
- 08.01Walkthrough: sys.argv Greeter例题: 命令行问候python-cmdline 8m
- 08.02Sum from argv命令行求和python-cmdline 15m
- 08.03argparse Basicsargparse 入门python-cmdline 20m
- 08.04argparse Defaultsargparse 默认值python-cmdline 20m
- 08.05Homework: wc Clone作业: wc 克隆python-cmdline python-file-io python-functions 45m
Recursion
递归
A function calls itself. With a base case to stop, recursion is the cleanest way to express problems that are naturally self-similar — factorial, fibonacci, list traversal, Euclid’s GCD. Strictly aligned with Think Python §5.7-§5.10 + §6.6-§6.9.
Decomposition
程序分解
How to write a 200-line program without going crazy. Incremental development (small steps, scaffolding, test as you go) + composition (assemble small functions into bigger ones). Strictly aligned with Think Python §3.11, §6.2, §6.3.
- 10.01Walkthrough: Distance (Incremental Build)例题: 距离 (增量构建)python-decomposition python-functions 10m
- 10.02Hypotenuse斜边python-decomposition python-functions 15m
- 10.03Area of Shapes多形状求面积python-decomposition python-functions 20m
- 10.04Refactor Monolith拆分大函数python-decomposition python-functions 25m
- 10.05Homework: GPA Calculator作业: GPA 计算器python-decomposition python-functions 40m