Implement your algorithm using Python BiggerLettersNumberEncrypted=[] BiggerAlphabet='A' letters=[] Encrypt=[] MessageAfterEncrypt='' for i in range(0,26): letters.append(BiggerAlphabet) BiggerAlphabet=chr(ord(BiggerAlphabet)+1) message=input ("Enter the message:") for i in range(len (message)): index=letters.index(message[i])
Implement your
BiggerLettersNumberEncrypted=[]
BiggerAlphabet='A'
letters=[]
Encrypt=[]
MessageAfterEncrypt=''
for i in range(0,26):
letters.append(BiggerAlphabet)
BiggerAlphabet=chr(ord(BiggerAlphabet)+1)
message=input ("Enter the message:")
for i in range(len (message)):
index=letters.index(message[i])
BiggerLettersNumberEncrypted.append(index+1)
print(BiggerLettersNumberEncrypted)
for i in range(len (message)):
for j in range(i+1,len (message)):
if BiggerLettersNumberEncrypted[i]>BiggerLettersNumberEncrypted[j]:
BiggerLettersNumberEncrypted[i]=BiggerLettersNumberEncrypted[i]-BiggerLettersNumberEncrypted[j]
break
print(BiggerLettersNumberEncrypted)
for i in range(len (message)):
Encrypt.append(letters[BiggerLettersNumberEncrypted[i]-1])
for i in range(len (message)):
MessageAfterEncrypt= MessageAfterEncrypt+Encrypt[i];
print("Message Encrypt:" + MessageAfterEncrypt)
Step by step
Solved in 4 steps with 4 images