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...
No answers yet.
Log in to leave an answer
Blogs
Caching in JavaScript: Redis, Memcached, and Built-in Solutions for Node.js
Java vs Python for Backend: A Practical Comparison and Choice
Serverless Functions in PHP: AWS Lambda from A to Z
iOS App Version and Build in Swift: A Simple Solution