Strings In Depth19 / 19
Up next

Translate characters

# ROT-style char mapping
table = str.maketrans("abc", "xyz")
print("cab".translate(table))   # zxy
What you're solving

maketrans builds a mapping