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 SetsLists do not solve everything. This lecture fills in the other four containers, and answers the more important question — given a concrete problem, which one should you reach for.
PART 3
Problem Solving with AI
Break a problem apart, and read, review and verify code written by someone else — including an AI
- L7RecursionA function can call itself. That idea sounds like a party trick, but it is the most direct route through a whole class of problems — any problem you can restate as a smaller version of itself.
- L8AI-Assisted Programming I: Reading, Reviewing, TrustingFrom this lecture on you may use an AI to write code. But before you press enter, you need to be able to judge whether what it gave you is right — and that judgment is what this lecture is about.
PART 4
Abstraction and Organization
Structure a medium-sized program with classes and modules
- L9Classes I: Objects and EncapsulationA function packages a piece of logic. A class packages data together with the logic that acts on it. Once the things in your program start having their own state and behavior, it is time for classes.
- L10Classes II and ModulesTwo halves. The first is inheritance and polymorphism — giving classes relationships to each other. The second is modules: packing classes and functions into files, and a look at how Python actually runs your code.
PART 5
Robustness and the Real World
Reason about efficiency, handle failure, and work with messy real data
- L11Complexity, Exceptions and TestingEverything so far assumed valid input, clean data and small sizes. This lecture handles the real world, where a program can let 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.