Adopted new convention from template

This commit is contained in:
2022-10-03 15:59:00 +02:00
parent 787c771162
commit 5f36185d59

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python3 #!/usr/bin/env python
""" """
Created on 09 Oct 2021 Created on 09 Oct 2021
@@ -10,6 +10,7 @@ https://projecteuler.net/problem=57
""" """
from fractions import Fraction from fractions import Fraction
from utils import timeit from utils import timeit
@@ -36,7 +37,7 @@ def compute():
ans = 0 ans = 0
f = Fraction(1, 2) f = Fraction(1, 2)
for i in range(1000): for _ in range(1000):
f = 1 / (2 + f) f = 1 / (2 + f)
result = 1 + f result = 1 + f
if len(str(result.numerator)) > len(str(result.denominator)): if len(str(result.numerator)) > len(str(result.denominator)):
@@ -46,5 +47,4 @@ def compute():
if __name__ == "__main__": if __name__ == "__main__":
print(f"Result for Problem 57 is {compute()}")
print(f"Result for Problem 57: {compute()}")