The period of decimal fraction
📁 method, Advanced Python Topics, example
Task: Two integers are passed to the function int a, int b. You need to return the quotient a/b, and the repeating digits (period) need to be enclosed in brackets.
Examples:
1/3 => 0.(3) 29/12 => 2.41(6) 5/3 => 1.(6) I approached the problem using brute force. I sorted out the fractional part, searched for coincidences...