Created
September 26, 2024 03:56
-
-
Save EvgeniGordeev/37eb6bb5eadb64ba5de377c803f1b75e to your computer and use it in GitHub Desktop.
1/998001
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import decimal | |
import textwrap | |
# demo division 1/998001 | |
decimal.setcontext(decimal.Context(prec=9999)) | |
one = decimal.Decimal(1) | |
denom = decimal.Decimal(998001) | |
res = str(one/denom) | |
print(textwrap.fill(res, 100)) | |
nums = textwrap.wrap(res[4:], 3) | |
print(nums) | |
to_num = [int(i) for i in nums] | |
print(sorted(to_num)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment