Computer Science, asked by kavyasujith, 1 month ago

list the two forms fractional numbers in python

please answer fast

please only correct answer

brainliest guaranteed ​​

Answers

Answered by chahat10039
1

Use float.as_integer_ratio() : >>> (0.25).as_integer_ratio() (1, 4) (as of Python 3.6, you can do the same with a decimal. Decimal() object.)

Use the fractions.Fraction() type: >>> from fractions import Fraction >>> Fraction(0.25) Fraction(1, 4)

plz mark it brainliest ❤️✨❤️

Similar questions