Your question is ROT Cipher Shift. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Grubhub wants a lightweight way to obfuscate short internal delivery messages. Implement a Caesar cipher that shifts every English letter by k positions while preserving letter case and leaving digits, spaces, and punctuation unchanged.
Write encrypt_message(message, k), where message is a string containing printable ASCII characters and k is an integer. Return a new string with each uppercase letter shifted cyclically within A-Z and each lowercase letter shifted cyclically within a-z. The shift must wrap around, and negative values of k must shift letters backward. Non-letter characters must remain exactly unchanged.
For example, with k = 3, A becomes D, x becomes a, and ! remains !.
def encrypt_message(message, k):