loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.17603804852759897","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"ZGVmIGlzX3BhbGluZHJvbWljKG4pOiBuPXN0cihuKTsgcmV0dXJuIG49PW5bOjotMV0KCnBtYXgsIEwgPSAwLCAxMDAwMDAwMDAwMApmb3IgaSBpbiByYW5nZSg5OTk5OSwgOTAwMDAsIC0xKToKICAgIGZvciBqIGluIHJhbmdlKDk5OTkwLCA5MDAwMCwgKC0xMSBpZiBpJTExIGVsc2UgLTEpKToKICAgICAgICBwID0gaSpqCiAgICAgICAgaWYgcCA8IHBtYXg6IGJyZWFrCiAgICAgICAgaWYgcCA8IEwgYW5kIGlzX3BhbGluZHJvbWljKHApOiB4LCB5LCBwbWF4ID0gaSwgaiwgcAogCnByaW50ICJMYXJnZXN0IHBhbGluZG9tZSBwcm9kdWN0ID0gJTNkIHggJTNkID0gJTZkIiAlICh4LCB5LCBwbWF4KSBcCiAgaWYgcG1heCA+IDAgZWxzZSAiTm9uZSBmb3VuZC4i"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
def is_palindromic(n): n=str(n); return n==n[::-1]

pmax, L = 0, 10000000000
for i in range(99999, 90000, -1):
    for j in range(99990, 90000, (-11 if i%11 else -1)):
        p = i*j
        if p < pmax: break
        if p < L and is_palindromic(p): x, y, pmax = i, j, p
 
print "Largest palindome product = %3d x %3d = %6d" % (x, y, pmax) \
  if pmax > 0 else "None found."