Here is the code for the Vigenere Cipher:
BASE = ord("A") #65
print("Welcome to the keyword encrypter and decrypter!")
msg = ("FUN")
keyword = ("RUN")
list_out = []
for letter in msg:
a = (ord(letter) - (BASE)) #67 - 65 = 2
for character in keyword:
b = (ord(character) - (BASE)) #72 - 65 = 7
list_out.append(BASE + a + b) #65 + 2 + 7 = 74
("".join(str(list_out)))
I am trying to get the each letter from the message and the keywords to individually be taken away from 65, which is the BASE. Then at the end I want the BASE to be added to the results from a and b. I want the new letter appended to the list and printed. If anyone can help, it will be much appreciated.
Above I stated how the program should work however I am not sure what the problem/problems are. The main problem with my code is that nothing is being printed.