PROBLEM 8 (16 pts) - Rational fraction as decimal number Write a function which receives as input two positive integers
Posted: Wed Apr 27, 2022 3:37 pm
PROBLEM 8 (16 pts) - Rational fraction as decimal number Write a function which receives as input two positive integers m and n and returns a string containing the representation of the fraction as a decimal. def rationalFractionToDecimalNumber(m, n): --> It is known that when a rational fraction is represented as a decimal number, it is either finite or periodic. If it is periodic, the period should be denoted in brackets. Some examples: rationalFractionToDecimalNumber (5,8) "0.625" rational FractionToDecimalNumber (25,9) "2.(7)" rationalFractionToDecimalNumber (19,12) --> "11.58(3)" rationalFractionToDecimalNumber (400,99) --> "4.(08)" rationalFractionToDecimalNumber (1,28) "0.03(571428)" --> -->