Project Euler #4: Largest palindrome product

  • + 2 comments
    #!/bin/python3
    
    import sys
    
    
    t = int(input().strip())
    for a0 in range(t):
        n = int(input().strip())
        BP = 0
    
        while BP==0:
            n -=1
            if str(n)==str(n)[::-1]:
                for j in range(100, 999):
                    r = n/j
                    if r % 1 == 0 and r < 1000:
                        BP=n
                        break
      
        print(BP)