fork download
  1. plain=input()
  2. k=int(input())
  3. cipher=""
  4. for char in plain:
  5. if char.islower():
  6. new=ord('a')+(ord(char)-ord('a')+k)%26
  7. cipher+=chr(new)
  8. elif char.isupper():
  9. new=ord('A')+(ord(char)-ord('A')+k)%26
  10. cipher+=chr(new)
  11. else:
  12. cipher+=char
  13. print(cipher)
Success #stdin #stdout 0.02s 9308KB
stdin
Fp fk uj 3
3
stdout
Is in xm 3