Implement find_best_shift. This function takes a wordlist and a bit of encrypted text and
shift has been found is if all the words obtained after a shift are valid words. Note that this only
decoded by two separate shifts into different sets words. While there are various strategies for
. This simply determines if word is a valid word according to wordlist.
Hint: You may find the function string.split to be useful for dividing the text up into words.
"""
Decrypts the encoded text and returns the plaintext.
text: string
returns: 0 <= int 27
Example: >>> s = apply_coder('Hello, world!', build_encoder(8))
>>> s
'Pmttw,hdwztl!'
>>> find_best_shift(wordlist, s) returns
8
>>> apply_coder(s, build_decoder(8)) returns
'Hello, world!'
"""
### TODO
Once you’ve written this function you can decode your friend’s emails!
Dostları ilə paylaş: