Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 517 Bytes

README.md

File metadata and controls

15 lines (11 loc) · 517 Bytes

Challenge: Caesar Cipher

Given two arguments message (string) and shift (int), write a function that enciphers the message using a caesar (substitution) cipher with the supplied shift value.

Numbers, punctuation, and other non-alphabet characters should be passed through unchanged. Letter case should be preserved.

examples:

message = "ABC 123 xyz"
print(caesar(message, 2))  # prints "CDE 123 zab"

message = 'Myxqbkdevkdsyxc, iye mbkmuon dro myno'
print(caesar(message, 16))  # prints ???