Caesar Cipher
Medium 40 XPStrings
Commonly asked at Zoho
Read a line of text and a shift k. Shift every letter k places forward in the alphabet, wrapping around from z to a. Keep upper/lower case, and leave other characters unchanged.
- Input
- Line 1: text. Line 2: integer k (0 ≤ k ≤ 1000).
- Output
- The encrypted text.
Sample 1
Input
Hello, World! 3
Output
Khoor, Zruog!
Read input with input() (no prompt message) and print only the answer. Run tries the Input box; Submit checks all test cases.
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.The solution unlocks after 3 submissions.