Project Euler #4: Largest palindrome product

  • + 0 comments

    t = int(input().strip()) for a0 in range(t): n = int(input().strip()) palindrome = 0

    while palindrome==0:
        n -=1
        if str(n)==str(n)[::-1]:
            for j in range(100, 999):
                f = n/j
                if f%1 == 0 and f <= 999:
                    f= int(f)
                    palindrome=n
                    break
    
    print(palindrome)#, "\n factors:", j, "X", f)