4. Fractions

  • Fractions class from fractions

4.1. Defining fractions

from fractions import Fraction


a = Fraction(1, 3)
b = Fraction(1, 9)

a + b
# Fraction(4, 9)