Computer Science · Cheatsheet
Topic 0 · Programming Fundamentals (Python)
Chapter 3 · Lists & 2-D data
📋 Reference · always available
List
`nums = [10,20,30]`; `nums[0]` is 10; `nums[-1]` is the last.
Zero-indexed
First is index 0; last is `len(nums)-1`.
Logical size
Track a counter n for used slots; loop `range(n)`, not full length.
2-D list
`table[r][c]` = row r, column c (both from 0).
Nested loop
Outer rows × inner columns = rows×cols iterations.