From this post, one could also clean the non-alphabetic characters in the input message
as follows:
join([c for c in message if 'a' <= c <= 'z' || 'A' <= c <= 'Z'])
NB: updated the encrypt function above with half of that because added it after uppercasing.