Pythom1 Hacker rank Caesar Cipher https://www.hackerrank.com/challenges/caesar-cipher-1 Caesar Cipher | HackerRank Encrypt a string by rotating the alphabets by a fixed value in the string. www.hackerrank.com 1 2 3 4 5 6 7 8 9 10 11 12 def caesarCipher(s, k): # Write your code here answer = '' k = k% 26 for i in s: if i.isalpha(): if ord(i)+k>122 or (ord(i)90) : i = chr(ord(i) + k-26) else: i = chr(ord(i) + k) answer+=i return(a.. 2022. 11. 10. 이전 1 다음