Introduction to Computer Programming (UA-0002.002)
Fall 2013 -- Section 2: Python
Professor: Andrew Case

Final Exam Study Guide

Updates: None

No outside materials are allowed on the exam. You will be provided with some Python documentation (subject to updates) for use during the exam.

Final List of Topics

This is NOT an exhaustive list. Please refer to the class reading assignments.

Material covered before Midterm1 and Midterm2

New Readings:

New Suggested Programming Exercises:

New lecture Material

Data Structures

- Copying data structures:
  - references vs. copying
  - copying lists
  - copyting tuples (why not?!)
  - copying sets
  - copying dicts
- Sequence functions:
  - del, min(), max(), len()
- Nested data structures

File I/O

- File functions
  - open() options (r,w,r+,a,b,t)
  - file.close()
- Text I/O
  - read line by line
  - read entire file
  - read certain size
  - write data out
  - Functions: seek(), read(), write(), 
- Binary I/O
  - Pickling
    - reading a variable or data structure
    - reading multiple data structures
    - functions: dump(), load()

Exception Handling

- When to use with user input?
- When to use otherwise?
- keywords: try, except, finally

Recursion

- When to use it
  - what is the limiting factor
- Comparisons
  - factorial
  - fibonacci
  - fractals
- Algorithm design
  - Define algorithm using itself
  - Variable scope
  - Base case
  - Recursive case
    - Must get closer to the base case
  - Infinite recursion
    - cause and avoidance of
    - repercussions
  - Examples in code:
    - Factorial, fibonacci, box, spiral, etc.
- Advantages and disadvantages vs. iteration

© 2010-2014 Andrew I. Case