GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Notizen

CaesarCmk4

acheung Englisch 1 Seite

Inhalt der Notizen (1)

Seite 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]?')

Informationen

Beschreibung
Notiz am CaesarCmk4, erstellt von acheung am 19/03/2015.
Erstellt von
acheung
Aufrufe
5
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck