Post History
Python 3, 145 bytes lambda s:[dict({chr(i+c):chr((i+13)%26+c)for i in range(26)for c in(65,97)},**{chr(i+48):chr((i+5)%10+48)for i in range(10)}).get(c,c)for c in s] Try it online! Generates...
Answer
#1: Initial revision
# [Python 3], 145 bytes <!-- language-all: lang-python --> lambda s:[dict({chr(i+c):chr((i+13)%26+c)for i in range(26)for c in(65,97)},**{chr(i+48):chr((i+5)%10+48)for i in range(10)}).get(c,c)for c in s] [Try it online!][TIO-lasgkgcw] [Python 3]: https://docs.python.org/3/ [TIO-lasgkgcw]: https://tio.run/##XZBRT4MwFIXf@RU3NRvtJGSMjW2YqS/@AV/VmK4UVnWFtHdmhvDbsdSFJb7dfuece0/a/OCh1mlfwg5e@y9@3BccbP5SKIG0FQdD1a1g@TC4KUnZZJE5UNYGFCgNhutK0kXmiXCEZqtou2ZdNJtd4svNmF@xSTIfwL98MmcdiyuJVERiXAX2rUdp8V1wK60r2Aak0hxBmU9AaQwnkANBtwK@5RkqI6UmUUAWy2zjpfU2SQdwM5k@RnF@9@Dp9eWk5xqTNF7BFJ72VbaJ595ymR296M7aBYGvrZsTRiDPjRQoi6HntWSsUB4tZXkAUJ/QOV3tMIw/avczJfVZxpzYGKWRliFpPesI7O6BtH@ZjoSDh1srDY57duPN/hc "Python 3 – Try It Online" Generates and concatonates 2 dicts: `{chr(i+c):chr((i+13)%26+c)for i in range(26)for c in(65,97)}` -> `{'A': 'N', 'a': 'n', 'B': 'O', 'b': 'o', 'C': 'P', 'c': 'p', 'D': 'Q', 'd': 'q', 'E': 'R', 'e': 'r', 'F': 'S', 'f': 's', 'G': 'T', 'g': 't', 'H': 'U', 'h': 'u', 'I': 'V', 'i': 'v', 'J': 'W', 'j': 'w', 'K': 'X', 'k': 'x', 'L': 'Y', 'l': 'y', 'M': 'Z', 'm': 'z', 'N': 'A', 'n': 'a', 'O': 'B', 'o': 'b', 'P': 'C', 'p': 'c', 'Q': 'D', 'q': 'd', 'R': 'E', 'r': 'e', 'S': 'F', 's': 'f', 'T': 'G', 't': 'g', 'U': 'H', 'u': 'h', 'V': 'I', 'v': 'i', 'W': 'J', 'w': 'j', 'X': 'K', 'x': 'k', 'Y': 'L', 'y': 'l', 'Z': 'M', 'z': 'm'}` for ROT13 `{chr(i+48):chr((i+5)%10+48)for i in range(10)}` -> `{'0': '5', '1': '6', '2': '7', '3': '8', '4': '9', '5': '0', '6': '1', '7': '2', '8': '3', '9': '4'}` for ROT5 It then gets the corresponding item from the concatonated dicts for each character in the input string. Inputs as a string, outputs as a list