Is there any way to access denominator of a fraction in Python 2
>>> from fractions import Fraction>>> a = Fraction(1,2)>>> a.denominator2
Additionally Python's help()
method can be very useful to determine exactly what methods and properties exist for an object. In the example above you could get a help description for the Fraction
object by help(Fraction)
or help(a)
in an interpreter session.