You are viewing a single comment's thread. Return to all comments →
A python solution
alpha = 'abcdefghijklmnopqrstuvwxyz' n = k % 26 newA = alpha[n:] + alpha[:n] r = '' for letter in s: if letter.isalpha(): isUpper = letter.isupper() if isUpper: letter = letter.lower() index = alpha.find(letter) newLetter = newA[index] if isUpper: newLetter = newLetter.upper() r += newLetter else: r += letter return r
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 →
A python solution