PASTEBIN
| #1 paste tool since 2002
create new paste
tools
api
archive
faq
PASTEBIN
create new paste
trending pastes
sign up
login
my alerts
my settings
my profile
Don't like ads?
PRO users
don't see any ads ;-)
Public Pastes
Untitled
1 sec ago
Untitled
1 sec ago
Untitled
5 sec ago
Untitled
11 sec ago
Untitled
11 sec ago
Untitled
11 sec ago
LFI Dork
15 sec ago
pss
22 sec ago
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)
"""Find the largest palindrome made from the product of two 3-digit numbers."""
from itertools import combinations as cnr
print max([ x*y for (x,y) in cnr(range(100,999),2) if str(x*y) == str(x*y)[::-1]])
create a
new version
of this paste
RAW Paste Data
"""Find the largest palindrome made from the product of two 3-digit numbers.""" from itertools import combinations as cnr print max([ x*y for (x,y) in cnr(range(100,999),2) if str(x*y) == str(x*y)[::-1]])