Intro to Programming (Python)Final exam8 topics

Intro to Programming (Python) final exam study sheet

An intro Python final is mostly two kinds of question: read this code and say what it prints, and write a short function that does this. Midterms test the pieces one at a time, conditionals, then loops, then lists. The final mixes them, so a single question can need a loop over a dictionary, a string method, and an early return. Most finals are cumulative, with the later material (files, exceptions, classes) showing up in the longer write-the-code questions.

Some courses call it a crib sheet, some an aid sheet, others just your revision notes: the one page of syntax and gotchas you would otherwise look up.

Preview of the Python Programming reference sheet Cheat sheet locked
the reference sheet for this exam

The scope

What this exam usually covers

These are the question types an intro Python final usually grades; check them against the topics your course actually reached.

  • Code tracing Say exactly what a loop or function prints, line by line. Points go on off-by-one range() bounds, print versus return, and integer versus float division (7 // 2 is 3, 7 / 2 is 3.5).
  • Writing functions Parameters, return values, and default arguments. A function that prints the answer instead of returning it usually loses marks, as does a return inside the loop that exits on the first item.
  • Lists and mutation Indexing, slicing, append versus extend, and aliasing: b = a does not copy, so changing b changes a. Modifying a list while looping over it is a classic trace question.
  • Dictionaries and sets Counting with a dict, looping over keys, values, and items, and the KeyError you get from d[k] on a missing key versus d.get(k, 0). Sets for removing duplicates and fast membership.
  • Strings Strings are immutable, so s.upper() returns a new string and leaves s unchanged. split, join, strip, find, slicing with negative indices, and f-string formatting are the usual tools asked for.
  • Loops and nested loops for versus while, break and continue, and accumulator patterns (running total, max so far, building a new list). Nested-loop questions often ask how many times the inner body runs.
  • Files and exceptions Open a file with a with block, read lines, strip the newline, and convert types. try/except around int() or a missing file, and which except clause catches which error.
  • Simple classes Writing __init__, storing attributes on self, adding a method, and __str__. Forgetting self as the first parameter or as the prefix on an attribute is where points go.

Usually later

Recursion, list comprehensions, lambda, and big-O are taught in some intro courses and skipped in others; they may appear as one short question or not at all. Inheritance and generators are usually beyond an intro final. Check the posted review sheet for which of these your course covered and whether the final weights the last weeks more heavily.

The rules

What a note sheet is usually allowed to include

check your exam header — it wins

Note rules for intro programming finals vary more than in most subjects. Many are closed-book and closed-notes because the point is to show you can write code without looking it up, and some print a short reference of common string and list methods on the exam itself. Others allow one page or one side of handwritten notes, and a few are open-book or run on a locked-down computer. In Canada this is often called an aid sheet, in the UK a crib sheet. The syllabus decides. This page is a study sheet either way: writing the syntax out by hand is good practice for writing code on paper.

The sheet

The matching library sheet

A one-page reference for the whole topic, fact-checked, with the first part free to read. This exam page does not repeat it. Use it to see the material, then make a shorter study sheet from the notes your section actually used.

Make your own for this exam

Upload the lecture slides and the lab or homework problems the final covers, not a whole textbook. In the focus step, name the topics the review session stressed, for example tracing nested loops or dictionary counting. Choose one page, front and back, or an index card to match what your course allows.

Make this from your notes

FAQ

Questions

What should go on an intro Python final study sheet?
The things you would otherwise look up: string and list method names and what they return, dict methods, range() bounds, the try/except shape, the with open() pattern, and a class template with __init__ and self. Add the traps you have personally hit, such as print versus return and aliasing.
Can I bring a crib sheet to an intro programming final?
Only if your course says so. Many intro programming finals are closed-notes, some allow one handwritten page, and a few are open-book. Check the syllabus or ask the instructor; do not assume the midterm rule carries over.
How do I study for code-tracing questions?
Trace by hand with a table of variable values per line, then run the code to check. Most lost points come from range() endpoints, mutation through aliases, and a return placed inside a loop.
How is this different from the Python library sheet?
The library sheet is a general Python reference covering types, collections, comprehensions, functions, classes, exceptions, and file I/O. This page is about the final: what it usually grades and how to build a sheet from your own course notes.