For the code to generate `zen of python'.

Hongyi Zhao hongyi.zhao at gmail.com
Wed Aug 7 09:11:56 EDT 2019


Hi here,

I noticed that the `zen of python' is generated by the following code:

d = {}
for c in (65, 97):
    for i in range(26):
        d[chr(i+c)] = chr((i+13) % 26 + c)

print("".join([d.get(c, c) for c in s]))


But the above code is not so easy for me to figure out.  Could someone 
please give me some explanations on it?

Regards
-- 
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.



More information about the Python-list mailing list