Created
November 10, 2020 16:00
-
-
Save AnnikaNoren/b400833c2e1fffe5a8558128acd75feb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def encrypt(word): | |
replacers = {'a':0, 'e' :1, 'i':2, 'o':2,'u':3} | |
word_as_list = list(word[::-1]) | |
def replace(list, dictionary): | |
return [replacers.get(item, item) for item in list] | |
replaced_list = replace(word_as_list,replacers) | |
list_to_string = ''.join([str(elem) for elem in replaced_list]) | |
list_to_string += 'aca' | |
return(list_to_string) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment