def pali(a): return str(a) == str(a)[::-1] print('Biggest palindromic product of two three digit integers is %i, which is %i * %i.' % max((a*b, a, b) for a in range(999, 100, -1) for b in range(a, 100000//a, -1) if pali(a*b))) """ Output: Biggest palindromic product of two three digit integers is 906609, which is 993 * 913. """
Edited by hughesadam_87
Edited by pyTony
Are you able to help answer this sponsored question?
Questions asked by members who have earned a lot of community kudos are featured in order to give back and encourage quality replies.