Automatic commit performed through alias...
This commit is contained in:
@@ -60,10 +60,12 @@ def main():
|
||||
n_has_token = False
|
||||
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
|
||||
n_has_token = True
|
||||
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
|
||||
n_has_token = True
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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))
|
||||
|
||||
if m ==1:
|
||||
n_has_token = True
|
||||
m = n-1
|
||||
|
||||
print("The largest palindrome number which is a product of two numbers of length {} is {} ... ".format(factor_length,max(palindrome_list)))
|
||||
|
||||
main()
|
||||
Reference in New Issue
Block a user