Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from string import ascii_lowercase as lower, ascii_uppercase as upper
- def rot(n: int) -> dict:
- return dict(zip(lower[n:]+lower[:n]+upper[n:]+upper[:n], lower+upper))
- def decode(s: str, n: int) -> str:
- mapping = rot(n)
- return ''.join(mapping.get(c,c) for c in s)
- print(decode('Jgnnq, yqtnf!', 2))
Add Comment
Please, Sign In to add comment