Adopted new convention from template
This commit is contained in:
parent
f7f87e03a3
commit
836d22e271
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python
|
||||||
"""
|
"""
|
||||||
Created on 18 Mar 2017
|
Created on 18 Mar 2017
|
||||||
|
|
||||||
@ -20,9 +20,10 @@ def compute():
|
|||||||
|
|
||||||
Find the largest palindrome made from the product of two 3-digit numbers.
|
Find the largest palindrome made from the product of two 3-digit numbers.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
ans = 0
|
ans = 0
|
||||||
for i in range(100, 1000):
|
for i in range(100, 1_000):
|
||||||
for j in range(100, 1000):
|
for j in range(100, 1_000):
|
||||||
palindrome = i * j
|
palindrome = i * j
|
||||||
s = str(palindrome)
|
s = str(palindrome)
|
||||||
if s == s[::-1] and palindrome > ans:
|
if s == s[::-1] and palindrome > ans:
|
||||||
@ -32,5 +33,4 @@ def compute():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
print(f"Result for problem 4 is {compute()}")
|
||||||
print(f"Result for problem 4: {compute()}")
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user