Caesar Cipher

  • + 0 comments
    def caesarCipher(s, k):
        # Write your code here
        return "".join([chr(((ord(char) + (k % 26) - 97) % 26) + 97) if char.islower() else chr(((ord(char) + (k % 26) - 65) % 26) + 65) if char.isalpha() else char for char in s])