defCaesar(message,n):print'This program will encode your messages using a Caesar Cipher'printcodedMessage=""forchinmessage:if65<=ord(ch)<=90:newChar=ord(ch)+nif(newChar>90):newChar=newChar-26if(newChar<65):newChar=newChar+26codedMessage=codedMessage+chr(newChar)elif97<=ord(ch)<=122:newChar=ord(ch)+nif(newChar>122):newChar=newChar-26if(newChar<97):newChar=newChar+26codedMessage=codedMessage+chr(newChar)else:codedMessage=codedMessage+chr(ord(ch))print"The coded message is:",codedMessageCaesar('HFJXFW BTZQI MFAJ GJJS UWTZI TK DTZ!',-5)>ThisprogramwillencodeyourmessagesusingaCaesarCipher>Thecodedmessageis:CAESARWOULDHAVEBEENPROUDOFYOU!Caesar('Caesar WOULD HAVE BEEN PROUD OF YOU!',5)>ThisprogramwillencodeyourmessagesusingaCaesarCipher>Thecodedmessageis:HfjxfwBTZQIMFAJGJJSUWTZITKDTZ!Caesar('The quick brown fox jumps over the lazy dog ... ',17)>ThisprogramwillencodeyourmessagesusingaCaesarCipher>Thecodedmessageis:Kyvhlztbsifnewfoaldgjfmvikyvcrqpufx...Caesar('Kyv hlztb sifne wfo aldgj fmvi kyv crqp ufx ... ',-17)>ThisprogramwillencodeyourmessagesusingaCaesarCipher>Thecodedmessageis:Thequickbrownfoxjumpsoverthelazydog...
As an illustration, you shall try the output produced for the following entries: