python 3.x - how to define decryption of caeser cipher -
ok missed class , trying work did in there. 1 of problems fixing caeser cipher. believe have fixed except last part of course part i'm stuck on. have. #change t lowercase in plaintext #add : end of if statement def encrypt(plaintext, alphabet, key): plaintext = plaintext.lower() ciphertext = "" ch in plaintext: idx = alphabet.find(ch) if idx >= 0 , idx <= 25: ciphertext = ciphertext + key[idx] else: ciphertext = ciphertext + ch #add return ciphertext return ciphertext #add def decrypt line def decrypt(ciphertext, alphabet, key): plaintext = "" ch in ciphertext: idx = key.find(ch) #add , idx <= 25 if statement if idx >= 0 , idx <= 25: plaintext = plaintext + alphabet[idx] else: plaintext = plaintext + ch return pl