Exercises 11-16 of Learn Python The Hard Way.