>>> Rational((0.5*1/2)/(0.5*1/2+0.2)) 2501999792983609/4503599627370496
So I want this to give me a fraction of 5/9, is it possible to get that in python?
You can either use nsimplify instead of Rational or else use the limit_denominator on the Rational:
nsimplify
Rational
limit_denominator