CS1602 · Fall 2026
Introduction to Computation
A first programming course for students with no prior background. It starts from how computation works, moves through the language, data structures and algorithmic thinking, and ends with building something real alongside an AI assistant.
Day to day you work here; at the end of term you hand the evaluation report in on Canvas, which is also where grades and registry notices live.
Term in progress
Week 1 · Computation, Machines and Languages
Lectures
32 hours
Tuesday 10:00–11:40
Dongshangyuan 411
Labs
32 hours
Tuesday 18:00–19:40
Dongshangyuan 411
Language
Python 3.13
Slides in English · taught in Chinese
Assessment
50% final
HW 10 · solo 15 · team 25
Teaching team
- Instructor
- Dr. Tao Huang黄涛t.huang@sjtu.edu.cn
- Teaching assistants
Assignments go to the TA you are assigned; either of them will answer questions. Ask in the course group first — someone else usually wants the same answer.
How the course is organized
Sixteen lectures grouped into six parts. Each part closes on a specific skill.
PART 1
Foundations of Computation
Write a complete program on your own, using input, branching, loops and functions
- L1Computation, Machines and LanguagesThe first lecture teaches no syntax. It settles three questions instead: what lets a machine compute at all, what actually happens when a program runs, and why this course uses Python rather than something else.
- L2Characters and NumbersThere is nothing in a computer but ones and zeros. This lecture turns them back into things you recognize — letters, whole numbers, decimals — and explains why the decimals will lie to you.
- L3Strings, Variables and I/OPrograms have to deal with people — take something in, hand something back. This lecture also introduces functions, your first real weapon against complexity.
- L4Conditions, Loops and FunctionsSo far your programs run straight down the page and stop. This lecture adds the two things they have been missing — branching and repetition. With those, Python can express any computable process at all.
PART 2
Built-in Data Structures
Pick the right container for a problem and work with data in bulk
- L5ListsA single variable cannot hold a real problem. Lists are the container you will reach for most often in Python, and also the one that trips up beginners most — because underneath, a list is a reference, not a value.
- L6Tuples, Dictionaries, Strings and SetsTuples, dictionaries and sets solve tasks that lists handle poorly. String methods connect text to these containers, and the central question is which container fits a particular problem.
PART 3
Problem Solving with AI
Break a problem apart, and read, review and verify code written by someone else — including an AI
- L7RecursionA recursive function solves a task using smaller tasks of the same kind. Follow calls and returns, establish termination, and use recursion for nested data, divide and conquer, and backtracking. Compare the work and storage needed by recursive and iterative implementations.
- L8AI-Assisted Programming I: Specification, Review and VerificationA sample run is evidence, not an acceptance decision. Learn to specify a function, review its implementation, build independent checks, investigate a failure and document the code you choose to use.
PART 4
Abstraction and Organization
Structure a medium-sized program with classes and modules
- L9Classes I: Objects and EncapsulationOrganize related state and operations with classes. Follow initialization and method binding, check valid states, and distinguish instance attributes, class attributes, shared references, and class methods. Encapsulation provides an interface, not automatic access control.
- L10Classes II and ModulesReuse and override behavior, define Python operation protocols, and inspect real multi-file programs. Separate imported bindings from object mutation, then distinguish the interpreter environment, module caching, and compiled-code caching.
PART 5
Robustness and the Real World
Reason about efficiency, handle failure, and work with messy real data
- L11Complexity, Exceptions and TestingEvery program so far assumed valid input, clean data and small sizes. This lecture handles the real world, where a program lets you down in three ways: too slow, it crashes, or it is quietly wrong.
- L12Randomness, Text and FilesUntil now every piece of data has been written into your code. This lecture connects programs to the outside world — generating randomness, reading and writing files, handling encodings, and pulling what you need out of messy text with regular expressions.
PART 6
Pythonic Python and Modern Practice
Write Python that reads like Python, and deliver a real project with AI in the loop
- L13Iterables and GeneratorsYou have been writing for loops for twelve lectures without knowing what happens behind them. This lecture opens that up — and along the way lets you process data larger than memory.
- L14Functions, Functional Programming and ScopeA function is not merely a block of code you can call — it is a value you can pass around, return, and wrap. Grasp that and the Python constructs that look like magic stop looking like magic.
- L15AI-Assisted Programming II: From Prompt to ProjectL8 was about reviewing a function an AI wrote for you. This lecture is about how an AI participates in a whole project — and where it will reliably let you down.
- L16Multitasking, Review and BeyondThe last lecture. First one remaining piece of the picture — how a program does several things at once — then sixteen weeks assembled into one map, and finally where this course leads.