- python exercise from head_first book