continued fractions python