Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 30th, 2012  |  syntax: None  |  size: 0.20 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. """Find the largest palindrome made from the product of two 3-digit numbers."""
  2.  
  3. from itertools import combinations as cnr
  4.  
  5. print max([ x*y for (x,y) in cnr(range(100,999),2) if str(x*y) == str(x*y)[::-1]])