Add more solutions
This commit is contained in:
23
problem-55.py
Normal file
23
problem-55.py
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
def get_palindrome(num):
|
||||
return int(str(num)[::-1])
|
||||
|
||||
|
||||
def is_palindrome(num):
|
||||
return get_palindrome(num) == num
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
results = []
|
||||
for i in range(10, 10000):
|
||||
num = i + get_palindrome(i)
|
||||
counter = 0
|
||||
while counter < 50 and not is_palindrome(num):
|
||||
num += get_palindrome(num)
|
||||
counter += 1
|
||||
if not is_palindrome(num):
|
||||
results.append(i)
|
||||
print(len(results))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user