This document attempts to list the built-in functions, methods, and types that we expect every student will know well enough to ask about on exams.

Various operators (like ** and [i1:i2]) are not included on this list, nor are control constructs like for and def, but students are still expected to know them.

1 Exam 1

2 Exam 2

Since exam 1, we have covered

  • Boolean values (True and False) and operators (and, or, and not)
  • Test case selection and debugging strategies
  • Loops (while, for)
  • Collection types (str, list, tuple, range)
  • The basics of the dict datatype
  • Reading files and web sites
  • Reading tabular data (such as CSV)

In general, we find questions directly about tuple, test case selection, and debugging strategies do not fit well into our exams. However, the underlying concepts may appear in some way. We typically intentionally test all other topics.

We expect you to know the following built-in and library functions:

  • import random
    • random.randrange(lo, hi)
    • random.shuffle(list)
  • str
    • substring in string
    • string1 + string2
    • string.lower()
    • string.upper()
    • string.strip()
    • string.split()
    • string.split(delimiter)
    • string.find(substring)
  • list
    • element in lst
    • lst.append(value)
    • lst.insert(index, value)
    • lst.remove(value)
    • del lst[index]
    • lst.sort()
    • lst.reverse()
    • lst.index(element)
  • list(collection)
  • range(end)
  • range(start, end)
  • range(start, end, step)
  • dict
    • mapping.keys()
    • mapping.values()
    • mapping.items()
  • open(filename)
    • connection.read()
    • connection.readline()
    • some way of iterating lines (connection.readlines(), or connection.read().split('\n'), or for line in connection)
  • import urllib.request
    • urllib.request.urlopen(url)
    • stream.read().decode('utf-8')

3 Exam 3

  • try:/except:
  • import pygame, gamebox
    • box1.touches(box2)
    • box1.move_to_stop_overlapping(box2)
    • box1.move_both_to_stop_overlapping(box2)
    • camera.draw(box)
    • camera.display()
    • timer_loop(ticks_per_second, ticks) and the basics of how to write a ticks function, including
      • ticks’s argument is a collection of the keys beign pressed
      • ticks is invoked by gamebox many times ever second
  • import re
    • re.compile(r'...'), including the use of [], (), +, *, and ?
    • compiled_re.sub(replacement, text), including the use of \1 and the like
    • compiled_re.search(text)
    • compiled_re.finditer(text)
    • match.group()
    • match.group(n)
    • match.groups()
  • import os
    • os.remove(filename)
    • os.rename(old_name, new_name)
  • import os.path
    • os.path.exists(filename)
  • open(filename, 'w')
  • with open(...) as f:
  • print(..., file=f)
  • debugging strategies
  • everything listed for exams 1 and 2

Some exams from previous semesters:

Fall 2016

blank exam and key

Spring 2016

coding questions and rest of exam

We have covered a different set of topics (particularly since exam 2) than were covered in past semesters, so old exams are not necessarily the best indicator of future exams. We suggest that a more effective preparatory activity would be to re-do your old programming assignments on paper without consulting your notes, and then look at the practice excercises in the textbook.