Re: For the code to generate `zen of python'.

2019-08-07 Thread Thomas Jollans
On 07/08/2019 15.11, Hongyi Zhao wrote: > 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

Re: For the code to generate `zen of python'.

2019-08-07 Thread Paul Moore
It's basically a decryption of the string s in the same module, that's encoded using the ROT13 algorithm - https://en.wikipedia.org/wiki/ROT13. This isn't meant to be secure, it's basically a little bit of fun obfuscating the actual text. The code creates a dictionary mapping encoded characters to

For the code to generate `zen of python'.

2019-08-07 Thread Hongyi Zhao
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 g