You are viewing a single comment's thread. Return to all comments →
My solution is similar
n = int(input().strip()) s = input().strip() k = int(input().strip()) s = [chr(ord('a') + (ord(e)+k-ord('a'))%26 if ord(e) in range(ord('a'), ord('z')+1) else ord(e)) for e in s] s = [chr(ord('A') + (ord(e)+k-ord('A'))%26 if ord(e) in range(ord('A'), ord('Z')+1) else ord(e)) for e in s] print(''.join(s))
Seems like cookies are disabled on this browser, please enable them to open this website
Caesar Cipher
You are viewing a single comment's thread. Return to all comments →
My solution is similar