Automatic commit performed through alias...

This commit is contained in:
Shaun Setlock
2020-04-20 14:21:51 -04:00
parent 15a5a44560
commit dbc251f7e3

View File

@@ -13,10 +13,6 @@
import decorators
import time
# Create function that finds the next
# prime number when supplied with an
# intitial integer.
def is_palindrome(candidate):
"""
Returns a boolean to confirm if the passed
@@ -31,20 +27,18 @@ def is_palindrome(candidate):
# Convert maximum candidate to a list ...
listed_candidate = [int(i) for i in str(candidate)]
flipped_candidate = [int(i) for i in str(candidate)]
#print("{}".format(listed_candidate))
# Determine length of maximum candidate, and manipulate.
num_digits = listed_candidate.__len__()
digit_flips = int(num_digits/2)
for i in range(1,digit_flips):
#print("{}".format(i))
flipped_candidate[-i-1] = flipped_candidate[i]
flipped_candidate[-1] = flipped_candidate[0]
#print("{}".format(flipped_candidate))
# Compare ...
# Compare if the flipped version and the original
# candidate are identical.
# The function returns this test result...
if listed_candidate == flipped_candidate:
return True
else:
@@ -72,17 +66,7 @@ def main():
# Test for "palindrom-iness" ...
print("{} * {} = {}".format(n,m,n*m))
test_passed = is_palindrome(n*m)
# if not test_passed and n_has_token:
# n -= 1
# if n == 1:
# n_has_token = False
# n = max_factor
# elif not test_passed and not n_has_token:
# m -= 1
# n_has_token = True
# else:
# palindrome_list.append(n*m)
#
if test_passed:
palindrome_list.append(n*m)
if n_has_token: