Exam prep · Free college course

Introduction to Computer Science: 1,117 Free Flashcards

A complete first computer science course taught in Python, built from the 14 chapters of OpenStax Introduction to Python Programming plus a searching, sorting and Big-O unit and a testing and debugging unit. It runs from statements, expressions and types through decisions, loops, functions and scope, modules, strings, lists, and dictionaries, sets and tuples, then classes, recursion, inheritance, files and exceptions. Each chapter starts with a short notes card and then mixes recall, multiple choice, cloze, typed answers, true or false, and a few sequence cards. Many cards show a short snippet and ask what it prints or which exception it raises, and the classic beginner traps are seeded throughout: integer versus float division, aliasing, the mutable default argument, scope shadowing, off-by-one errors, and == versus is. Every snippet was run in real Python 3 before it went into a card. One honest limit: cards cannot run code. This course is the concept half of CS1, terminology, tracing and prediction, so use it alongside an editor or IDE, not instead of one. It does not ask you to write programs.

1,117cards
16units
80chapters
25sources cited

What's inside

Unit 1 Statements and the Python Environment

5 chapters · 53 cards

Unit 2 Expressions and Operators

5 chapters · 68 cards

Unit 3 Objects, Variables and Types

5 chapters · 83 cards

Unit 4 Decisions

5 chapters · 70 cards

Unit 5 Loops

5 chapters · 82 cards

Unit 6 Functions and Scope

6 chapters · 99 cards

Unit 7 Modules and Packages

3 chapters · 34 cards

Unit 8 Strings

5 chapters · 66 cards

Unit 9 Lists

6 chapters · 84 cards

Unit 10 Dictionaries, Sets and Tuples

5 chapters · 67 cards

Unit 11 Classes and Objects

6 chapters · 99 cards

Unit 12 Recursion

5 chapters · 66 cards

Unit 13 Inheritance

4 chapters · 49 cards

Unit 14 Files and Exceptions

6 chapters · 66 cards

Unit 15 Searching, Sorting and Big-O

5 chapters · 82 cards

Unit 16 Testing and Debugging

4 chapters · 49 cards

Try a few real cards

Copied straight from the course. In the app, each wrong option also gets its own explanation.

Card 1Which list can binary search be used on correctly?

  1. A list in random order
  2. A list that will be sorted after the search finishes
  3. A list already sorted in ascending order
  4. Any list with fewer than 100 items
Show answer

A list already sorted in ascending order. Binary search relies on order to decide which half can be thrown away, so its input must already be sorted.

Card 2Which lists the logical operators from highest precedence to lowest?

  1. or, and, not
  2. and, not, or
  3. not, and, or
  4. not, or, and
Show answer

not, and, or. not binds tightest, then and, then or, all looser than the comparison operators.

Card 3On [2, 5, 8, 12, 16, 23, 38, 56, 72, 91], searching for 2 (the first item), which search makes fewer comparisons?

  1. Linear search, with 1 comparison against 3 for binary
  2. Binary search, with 1 comparison against 3 for linear
  3. Both make exactly 3 comparisons
  4. Binary search, because it is always faster
Show answer

Linear search, with 1 comparison against 3 for binary. Best case for linear search is the first item (1 comparison). Binary search still has to narrow down to it (3 comparisons on this list).

Questions

Is the Introduction to Computer Science course really free?

Yes. Create a free Encodr account and all 16 units and 1,117 cards are yours to study, with spaced repetition scheduling your reviews.

Can I learn to code from flashcards alone?

No, and the course does not pretend to. Cards cannot run code, so it covers the concept half of CS1: vocabulary, tracing and predicting output, scope and mutability rules, naming the exception a snippet raises, and classifying Big-O. Use it next to an editor or IDE where you write and debug real programs.

Which textbook is it based on?

OpenStax Introduction to Python Programming (chapters 1 to 14, CC BY-NC-SA 4.0), plus the Python documentation and ACM computing curricula for the searching, sorting, Big-O and testing units. The cards are rewritten, not copied.

Which Python version do the cards use?

Python 3. Every snippet was run in Python 3 before it became a card, and cards that depend on error message wording say so or ask only for the exception type.

Does it include images or diagrams?

No. Cards are text only, so call stacks and sort passes are described step by step in words.

Keep going