PythiloMedium · 25 min · Task 78 of 100 · progress kept in this browser

Format a recurring decimal

Convert integer numerator divided by nonzero integer denominator to an exact decimal string. Enclose the recurring part in parentheses, with no redundant trailing decimal point.

remainder, divisor = 1, 6
digit, remainder = divmod(remainder*10, divisor)
print(digit, remainder)
Your task

Convert integer numerator divided by nonzero integer denominator to an exact decimal string. Enclose the recurring part in parentheses, with no redundant trailing decimal point.