ISBN2 by flagitious

while 1:
 r=raw_input()
 k=s=9
 while s:t=r.replace('?',`k`);s=sum(ord(c)%48%30*[i*10,33-i%2*22][len(r)/16]for i,c in enumerate(t[3:]))%110;k-=1
 print t

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return top