use fancy dict syntax

This commit is contained in:
Connor Olding 2021-06-27 17:06:48 +02:00
parent d24831a233
commit 5804ad6145

View file

@ -1,8 +1,8 @@
rot13_mapping = {}
for a, b, c, d in zip("anAN05", "mzMZ49", "naNA50", "zmZM94"):
rot13_mapping.update(dict((chr(k), chr(v))
for k, v in zip(range(ord(a), ord(b) + 1),
range(ord(c), ord(d) + 1))))
rot13_mapping.update({chr(k): chr(v)
for k, v in zip(range(ord(a), ord(b) + 1),
range(ord(c), ord(d) + 1))})
def rot13(s):