How to represent a float in a fraction in Python?