Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from fractions import Fraction
- fraccion1 = Fraction(2, 3)
- fraccion2 = Fraction(5, 7)
- print(fraccion1 + fraccion2)
- print(fraccion1 * fraccion2)
- print(fraccion1.numerator)
- print(fraccion1.denominator)
- print(float(fraccion2))
- numero = 0.5
- print(Fraction(*numero.as_integer_ratio()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement