The following is a list of all the material that we have covered this quarter. It is very large, and with 7 pages of questions over 110 minutes on the midterm, I will be able to cover just a small fraction of it all. My goal is to cover the most important material: material important enough to have been covered on quizzes and in programs. This is not a guarantee of what will/won't be on the exam, but an indication of what is typically on midterm exams. Material Covered/Midterm Week 0) Reading files simply and efficiently standard iteration (without readlines, read, comprehensions, etc.) calling rstrip and split a special function for parsing lines (it uses generators, covered week 4) Week 1) Review/Extension data types: list (sorting), tuple/named-tuple, set/frozenset, dict/defaultdict iterators : iterating over sorted/reversed data; 3 ways to iterate over dicts importing: forms and meanings construction on iterable data comprehensions function calls: argument/parameter binding options; *args/**kargs scope rules for binding a name and finding the binding of a name functions as arguments and return values from functions lambdas 9 important functions: split/join, all/any, sum/min/max, zip/enumerate sharing vs copying raising exceptions and exception/handling with try/except classes (__dict__ for object name spaces) Week 2) Text Patterns EBNF named rules; right hand sides: sequence, alternatives, choice, repetition proving symbols match rules (in English, etc.); syntax charats synthesizing rules from examples regular expressions elements of the matching language (e.g., what [], {}, |, ?, +, *, etc. mean) re functions: match, search, sub, split, compile specifying/extracting groups (numbered and named) after matching re methods on match objects: mostly group (by number/name) and groupdict Week 3) Classes how state and methods are stored in an object's namespace (using __dict__) the Fundamental Equation of Object Oriented Programming storing attributes the namespaces of instance objects and classes the meaing of _ and __ prefixes in attribute names operator overloading via dunder method definition misc: __init__, __len__, __bool__, __str__/__repr__ unary: +, -, abs relational arithmetic container: __getitem__, __setitem__, __delitem__, __contains__ function call: __call__ iterators: __iter__, __next__ attribute: __getattr__, __setattr__, __delattr__, __getattribute__ context managers: __enter__, __exit__ Week 4) Iterators how iterators work translating for loops into while loops with explicit calls to iter/next implementation of iterators for classes returning self: Countdown, prange implementation of iterators for classes returning an iterator objects constructed from a a nested class: improved prange and Percentage_Histogram generator functions semantic difference betwee calling functions/generator functions implementation of iterators with generator functions space efficiency (iterating over many value without storing them all) decorators for iterators using generators decorated is an iterable; decorator produces an iterable examples: repeat, unique, filter, enumerate, zip