Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
def encrypt(word):
replacers = {'a':0, 'e' :1, 'i':2, 'o':2,'u':3}
word_as_list = list(word[::-1])
replaced_list = [replacers.get(item,item) for item in word_as_list]
list_to_string = ''.join([str(elem) for elem in replaced_list])
list_to_string += 'aca'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment