Ex1 and Ex2 from Learn Python the Hard way