← Back to blog
Study science

What's in Intro to Computer Science: 16 Units in Python

What an intro to computer science course in Python covers, unit by unit: types, loops, functions, lists, dictionaries, classes, recursion, exceptions and Big-O.

An introductory computer science course (often called CS1) has two halves. One half is writing programs: sitting in an editor, getting errors, fixing them. The other half is concepts: what a line of code does before you run it, which exception it raises, why two names change together, how running time grows. Exams lean heavily on the second half, and it is the half you can study away from a keyboard.

Encodr's free Introduction to Computer Science course covers that concept half in Python 3. It follows the 14 chapters of OpenStax Introduction to Python Programming, plus a searching, sorting and Big-O unit and a testing and debugging unit, for 16 units, 80 chapters and 1,117 study cards from 25 sources. Every snippet in a card was run in real Python 3 before it was published. One honest limit: cards can't run code, so use the course alongside an editor, not instead of one.

Here is what each unit covers, in teaching order.

Python basics (units 1-3)

Unit 1, Statements and the Python Environment (5 chapters, 53 cards). Programs, statements and expressions, the interpreter and the REPL, print and input (and the fact that input always returns a string), comments, variables and assignment, and how to read a traceback: the exception type is on the last line, and the caret can point a line or two after the real mistake.

Unit 2, Expressions and Operators (5 chapters, 68 cards). Arithmetic and precedence (2 3 2 is 512 because ** groups right to left), true division versus floor division versus modulo, int, float and str conversion, floating-point round-off (0.1 + 0.2 is not exactly 0.3), and the math module.

Unit 3, Objects, Variables and Types (5 chapters, 83 cards). Identity, type and value; mutability and aliasing; == versus is; strings, escapes and f-strings; and first contact with lists and tuples. Aliasing is the idea that most often surprises beginners, and it comes back in units 6, 9 and 11.

Control flow (units 4-5)

Unit 4, Decisions (5 chapters, 70 cards). Booleans and comparisons, if, elif and else, and, or and not with short-circuit evaluation, truthiness (an empty list is false, the string "0" is true), conditional expressions, and nested decisions where indentation decides which if an else belongs to.

Unit 5, Loops (5 chapters, 82 cards). while loops and sentinels, for loops and range (the end is always excluded), break, continue and the loop else clause, nested loops, accumulators and off-by-one errors.

These two units are mostly tracing: read the code, predict the output.

Functions and modules (units 6-7)

Unit 6, Functions and Scope (6 chapters, 99 cards, tied for the largest unit). Defining and calling functions, parameters versus arguments, positional and keyword arguments, return versus print, local and global scope with the LEGB lookup order, pass by object reference, lambda, and the mutable default argument trap, where a default list quietly keeps its contents between calls.

Unit 7, Modules and Packages (3 chapters, 34 cards, the smallest unit). import forms and namespaces, the standard library, help(), pip and PyPI, and the if __name__ == "__main__": guard.

Data structures (units 8-10)

Unit 8, Strings (5 chapters, 66 cards). Indexing and slicing, string immutability, comparison by character code ("10" < "9" is True), find versus index versus in, split and join, and formatting.

Unit 9, Lists (6 chapters, 84 cards). Indexing and slicing, in-place methods that return None (so names = names.append(x) throws the list away), sort versus sorted, shallow copies and aliasing, nested lists for 2-D data, and list comprehensions.

Unit 10, Dictionaries, Sets and Tuples (5 chapters, 67 cards). Tuples and unpacking, dictionary creation and lookup, KeyError versus get, iterating with items(), dictionary comprehensions, sets and set operations, and hashability (why a list can't be a dictionary key).

Objects and recursion (units 11-13)

Unit 11, Classes and Objects (6 chapters, 99 cards, tied for the largest). Classes and instances, __init__ and self, instance versus class attributes, methods, __str__ and __repr__, operator overloading, and encapsulation by convention.

Unit 12, Recursion (5 chapters, 66 cards). Base cases and recursive cases, the call stack, factorial, Fibonacci and powers, recursion on strings and lists, and recursion versus iteration (including RecursionError, since Python has a depth limit).

Unit 13, Inheritance (4 chapters, 49 cards). Is-a relationships, overriding and super(), multiple inheritance and method resolution order, and when composition (has-a) is the better choice.

Robust code and algorithms (units 14-16)

Unit 14, Files and Exceptions (6 chapters, 66 cards). Reading and writing files, the with statement, file paths, CSV, try, except, else and finally, identifying which exception a snippet raises, and raising your own.

Unit 15, Searching, Sorting and Big-O (5 chapters, 82 cards). Linear and binary search, selection and insertion sort, merge sort, Big-O notation, and classifying code snippets by growth rate. This is the most mathematical unit in the course; Big-O notation explained for beginners walks through it with runnable examples.

Unit 16, Testing and Debugging (4 chapters, 49 cards). Debugging strategies, test cases and edge cases, assert and unittest, and the common bug patterns the whole course has been seeding.

What kind of studying each part needs

Mostly tracing and predictionMostly vocabulary and rules
Units 2, 4, 5 (operators, decisions, loops)Unit 1 (interpreters, error types)
Units 6, 9, 10 (functions, lists, dictionaries)Unit 7 (modules and packages)
Unit 12 (recursion), unit 15 (Big-O)Units 13 and 16 (inheritance terms, testing terms)

Cards mix recall, multiple choice, cloze, typed answers, true or false and a few sequence cards. Many show a short snippet and ask what it prints, and the classic beginner traps (integer versus float division, aliasing, mutable defaults, scope shadowing, off-by-one, == versus is) recur across units on purpose. How to study for Intro to Computer Science explains how to pair the cards with hands-on coding.

Planning around it

CS1 is cumulative. Recursion assumes functions; classes assume functions, scope and aliasing; Big-O assumes loops. A final will pull from all of it, so the approach in studying for a cumulative final vs a unit test applies directly. Mixing old and new units in review, rather than finishing one and never returning, is the idea behind interleaving vs blocking. To see how long 1,117 cards takes at your pace, try the flashcard deck time estimator.

If you are heading toward IT or security, this course pairs naturally with a certification: how to study for Security+ SY0-701 covers an exam where knowing how programs handle input makes application attacks such as injection, buffer overflows and race conditions much easier to follow. And if you are taking CS1 alongside a business course, how to study for Financial Accounting describes a similar learn-the-rules-then-drill-problems rhythm.

The course is one of Encodr's free college gen-ed course flashcards. Start the Intro to Computer Science flashcards free.

Encodr turns this into a habit: study anything in a feed, and it schedules the rest.

Get started free

Related posts