Automatic commit performed through alias...

This commit is contained in:
Shaun Setlock
2020-04-20 14:45:04 -04:00
parent dbc251f7e3
commit d1552c9179

View File

@@ -61,9 +61,11 @@ def main():
test_passed = False
palindrome_list=[]
while (n*m)>0:
# Test for "palindrom-iness" ...
while (n*m)>1:
# Loop over all possible pairs of
# integers, testing for "palindrom-iness" ...
print("{} * {} = {}".format(n,m,n*m))
test_passed = is_palindrome(n*m)
@@ -71,32 +73,28 @@ def main():
palindrome_list.append(n*m)
if n_has_token:
n -= 1
if n ==1:
if n ==0:
n_has_token = False
n = max_factor
n = m-1
if not n_has_token:
m -= 1
if m ==1:
n_has_token = True
m = n-1
if not test_passed:
if n_has_token:
n -= 1
if n ==1:
if n ==0:
n_has_token = False
n = max_factor
n = m-1
if not n_has_token:
m -= 1
if m ==1:
n_has_token = True
m = n-1
print("{}".format(max(palindrome_list)))
# print("{} * {} = {}".format(n,m,n*m))
# print("The largest palindrome number which is a product of two numbers of length {} is {} ... ".format(num_digits,num_digits))
print("The largest palindrome number which is a product of two numbers of length {} is {} ... ".format(factor_length,max(palindrome_list)))
main()