GoConqr has a new look! Let us know what you think.

Notes

CaesarCmk4

acheung English 1 page

Content of the notes (1)

Page 1

Version:1.0

StartHTML:0000000166

EndHTML:0000007605

StartFragment:0000001987

EndFragment:0000007569

SourceURL:file:///Users/aleccheung/Documents/Caesar%20C.doc

#Fully functional Caesar Cipher decryption

program

program='y'

while program.lower()=='y':

Normal=input ('Please enter the sentence you

wish to encrypt (numbers and symbols will not be encrypted): ')

Key=input('Please enter the key (1-26) ')

total=""

if (int(Key))

for char in Normal:

if char.isupper():

EncryptedU=ord(char)-int(Key)

if EncryptedU

EncryptedU=EncryptedU+26

total=total+chr(int(EncryptedU))

else:

total=total+chr(int(EncryptedU))

elif char.islower():

EncryptedL=ord(char)-int(Key)

if

EncryptedL

EncryptedL=EncryptedL+26

total=total+chr(int(EncryptedL))

else:

total=total+chr(int(EncryptedL))

else:

total=total+(char)

print('Your Encrypted

message is: '+total)

program=input('Encrypt

another program [y/n]?')

Information

Description
Note on CaesarCmk4, created by acheung on 19/03/2015.
Created by
acheung
Views
5
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?