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

# Final Exam Study Guide

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

• Starting Out With Python: Chapters 7, 10, 13

### New Suggested Programming Exercises:

• Homeworks!
• Chapter 7: Prog. Exer 1, 3, 4, 5, 6, 7, 8, 9
• Chapter 8: Prog. Exer 7
• Chapter 10: Prog. Exer 3, 4, 5, 6, 8, 9
• Chapter 13: Prog. Exer 1, 2, 3, 8

### 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
- write data out
- Binary I/O
- Pickling
- reading a variable or data structure
```

#### 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.