revenge of the python puzzle

Delaney, Timothy tdelaney at
Thu Sep 26 07:09:03 CEST 2002

> From: Michal Wallace [mailto:sabren at]
> Okay, so you guys think you're so smart. Try this one!  No
> contest this time, I've learned my lesson.  (I suppose if
> someone really wants some free hosting bad enough to solve
> this puzzle, you could talk me into it, but I'm just posting
> this for revenge... Um, I mean "fun".)

Hmm - a little bit harder. The fake perl actually made it easier though
(gave while and s).

def decrypt(yourstring):
    dedict = {
        'a': 'm',
        'b': 'r',
        'c': 'y',
        'd': 'j',
        'e': 'b',
        'f': 'd',
        'g': 'l',
        'h': 'i',
        'i': 'e',
        'j': 'u',
        'k': 'w',
        'l': 'v',
        'm': 'o',
        'o': 'k',
        'p': 't',
        'q': 'g',
        's': 's',
        't': 'x',
        'u': 'p',
        'v': 'f',
        'w': 'c',
        'x': 'h',
        'y': 'n',
        'z': 'a',
    return "".join([dedict.get(i,i) for i in yourstring])

data = r'''wbjig_ucpxmy, kxzp_xzli_h_fmyi \
"zkvjg wmfi hs sm ajwx vjy"
hv 'h za sazbp': 'hp djsp ahqxp bjy'
"hp's sm ajwx kmbsi pxzy 'xiggm kmbgf'"
"kxc, pxisi yitp ghyis zgamsp gmmo ghoi uibg!"

ezf="'iyhpgzlm bjmc oyhbf'=qsa;qsa gzemgqtqsa pyhbu";
iaupc="";qgmezg izwxmyi;ilhg=[];

'ejp z siwbip xibi hs hy cmjb bizwx'
zuugis=mbzyqis, "izwxmyi=izwx"
fiv fm(pzso="fm kxzp h zso"):
     qgmezg izwxmyi; itiw pzso
"zyf djsp hy wzsi cmj'bi ymp uibugitif,"
kmbsi,ymk = (ezf.sughp('t'),"!")
vmb izwx hy kmbsi:
    itiw zuugis[1]
    hv izwx hy kmbsi:

kmbsi = ilhg; "ilhg".sughp().bilibsi()
[izwx.bilibsi() vmb izwx hy kmbsi]
"zyf ymk ki'li bizwxif pxi vhyzg libsi";
azu(fm, azu(iaupc.dmhy, kmbsi))'''

print decrypt(data)

More information about the Python-list mailing list