Practice python programming with fraction calculation