What is the source code of the "this" module doing?
Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Over a Mysterious Island Looping
--
Chapters
00:00 Question
02:20 Accepted answer (Score 211)
02:49 Answer 2 (Score 27)
03:32 Answer 3 (Score 18)
03:59 Answer 4 (Score 12)
04:12 Thank you
--
Full question
https://stackoverflow.com/questions/5855...
Accepted answer links:
[rot13]: http://en.wikipedia.org/wiki/ROT13
Answer 3 links:
[ROT13]: https://en.wikipedia.org/wiki/ROT13
Answer 4 links:
[rot13]: http://en.wikipedia.org/wiki/ROT13
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python
#avk47
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Over a Mysterious Island Looping
--
Chapters
00:00 Question
02:20 Accepted answer (Score 211)
02:49 Answer 2 (Score 27)
03:32 Answer 3 (Score 18)
03:59 Answer 4 (Score 12)
04:12 Thank you
--
Full question
https://stackoverflow.com/questions/5855...
Accepted answer links:
[rot13]: http://en.wikipedia.org/wiki/ROT13
Answer 3 links:
[ROT13]: https://en.wikipedia.org/wiki/ROT13
Answer 4 links:
[rot13]: http://en.wikipedia.org/wiki/ROT13
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python
#avk47
ACCEPTED ANSWER
Score 215
This is called rot13 encoding:
d = {}
for c in (65, 97):
for i in range(26):
d[chr(i+c)] = chr((i+13) % 26 + c)
Builds the translation table, for both uppercase (this is what 65 is for) and lowercase (this is what 97 is for) chars.
print "".join([d.get(c, c) for c in s])
Prints the translated string.
ANSWER 2
Score 27
If you want to make the ROT13 substitution by hand - or in your head - you can check that because 13*2 = 26 (the number of the letters of the English alphabet), it's essentially an interchange:
a <-> n
b <-> o
c <-> p
...
m <-> z
A <-> N
B <-> O
C <-> P
...
M <-> Z
Vs lbh cenpgvfr ybat rabhtu, lbh'yy riraghnyyl znfgre gur Mra bs EBG-13 nytbevguz naq ernq guvf Xyvatba ybbxvat grkgf jvgubhg pbzchgre uryc.
ANSWER 3
Score 12
It's a substitution cipher, rot13.
ANSWER 4
Score 10
It's a substitution cipher (as mentioned in previous answers). Historically speaking, it's the Caesar cipher.