Skip to content

Topics

These are suggestions for your topic presentation, organized by the week they fit. Each week is split into topics that follow the syllabus and topics outside of it.

You may take one of these word for word, narrow it down to the part you find most interesting, or propose something of your own. Whatever you choose has to fit the week you signed up for. A topic outside of the syllabus has to be approved first, because an idea can be too early or too late: too early leans on material we have not covered yet, and too late is a talk the class needed weeks ago. Ask your instructor before you claim the slot.

Sign up on your section's sign-up sheet on Canvas. See Demos for how the sheet works, and the Rubric for what the professor looks for.

Week 3: Expressions, types, and indexing

Following the syllabus

  • f-strings (formatted string literals)
  • Integer division (//) and remainder (%): what they compute, and what they are good for
  • Indexing a string, including what negative indexes do

Outside of the syllabus

  • More about the Linux command line (cd, ls, mkdir, cp, mv, rm)
  • Thonny's debugger
  • Reading a traceback: what Python's error messages are actually telling you
  • What ruff checks, and why style rules exist

Week 4: Branches and boolean logic

Following the syllabus

  • if / elif / else: how the chain is evaluated, and why order matters
  • and, or, and not: truth tables, short-circuit evaluation, and which values count as true
  • Nested conditions, and when to flatten one into an elif chain
  • Using help() to read the documentation of a built-in function

Week 5: Functions, tuples, and documentation

Following the syllabus

  • Functions, parameters, arguments, and return values
  • Tuples: grouping values, and returning more than one value from a function
  • Local and global scope: which names a function can see
  • Trying a function out under if __name__ == "__main__"

Outside of the syllabus

  • Default and keyword function arguments

Week 6: For loops, lists, and ranges

Following the syllabus

  • range() with one, two, and three arguments — and off-by-one errors
  • The accumulator pattern: summing, counting, and averaging a list of numbers
  • Changing a list in place: append(), index assignment, removal, and sorting

Outside of the syllabus

  • Drawing with turtle graphics
  • Using nested for loops to draw shapes

Week 8: Strings, dictionaries, and testing

Following the syllabus

  • Writing your first pytest test: assert, test names, and running it
  • Looping over the characters of a string to count and search
  • Counting with a dictionary: setting a value, updating it, and checking whether a key is there

Outside of the syllabus

  • Using git from VS Code
  • What is a git branch?
  • Type hints, and what VS Code does with them

Week 9: While loops and sets

Following the syllabus

  • While loops: initialization, condition, update
  • while vs. for: choosing the right loop, with examples of each done wrong
  • Sets: membership, removing duplicates, and keeping track of what you have already seen

Outside of the syllabus

  • The random module, and a small simulation you can run with it

Week 10: Files and strings

Following the syllabus

  • Reading a text file line by line, and writing one back out
  • String functions: split(), strip(), join(), and the case methods
  • Slicing a string, and how a slice differs from an index
  • Strings cannot be changed and lists can — and why that matters when you pass one to a function

Week 11: Dictionaries

Following the syllabus

  • Looking a value up by its key, and what happens when the key is missing
  • Iterating over a dictionary: keys, values, and items
  • List, set, and dictionary comprehensions

Week 12: Nested data structures

Following the syllabus

  • Lists of dictionaries
  • JSON: what it looks like, and loading it into nested lists and dictionaries
  • Reading a CSV file into a list of dictionaries

Outside of the syllabus

  • Plotting data with matplotlib

Week 13: Project planning

Week 13 is a project week, so everything here is outside of the syllabus. Pick something the class can use on their own projects.

  • Debugging with breakpoints: stepping through a program to see what it is really doing
  • Installing a package with pip, and something fun you can do with one
  • Recursion: a function that calls itself (a preview of CS 159)

Any week

  • Your favorite programming tool
  • Using a specific AI tool to study: what it is good at, and how to avoid "not actually learning" while using it