Can someone explain rot13 in python?
It's bugging me for days.. def rot_13(): encoding={} abc='abcdefghijklmnopqrstuvwxyzabcdefghijklm' ABC='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM' for i in range(0,26): encoding.update({abc[i] : abc[i+13]}) encoding.update({ABC[i] : ABC[i+13]}) return encoding print(rot_13()) def decode(s): key = rot_13() sentence = [] for i in range(0, len(s)): if key.get(s[i], 'none') != 'none': sentence.append(key[s[i]]) else: sentence.append(s[i]) new_sentence = ''.join(sentence) return new_sentence print(rot_13('V NZ YRNEAVAT CLGUBA JVGU FUR PBQRF NPNQRZL!')) https://code.sololearn.com/c3rA9QJWSEse/?ref=app https://code.sololearn.com/c3rA9QJWSEse/?ref=app