Hi and thanks,
i’m a begginer in python and i’m tyring coded correspondace strings chapter. I understand about Caesers and solves. but vigenere are more confused.
could you help with this:
<alphabet = “abcdefghijklmnopqrstuvwxyz”
cipher_msg = “dfc aruw fsti gr vjtwhr wznj? vmph otis! cbx swv jipreneo uhllj kpi rahjib eg fjdkwkedhmp!”
keyword = “friends”
un_cipher=“”
for i in range(0,len(cipher_msg)):
if (cipher_msg[i]==" ") or (cipher_msg[i] == “=”) or (cipher_msg[i] == “?”) or (cipher_msg[i] == “!”) or (cipher_msg[i] == “.”):
un_cipher+= cipher_msg[i]
elif (cipher_msg[i] != " ") or (cipher_msg[i] != "=") or (cipher_msg[i] != "?") or (cipher_msg[i] != "!") or (cipher_msg[i] != "."):
pos = ((alphabet.find(cipher_msg[i])-alphabet.find(keyword[i]))%26)
un_cipher += alphabet[pos]
print (un_cipher)
am not sure what am doing bad.