Skip to content

Instantly share code, notes, and snippets.

@AnnikaNoren
Created November 10, 2020 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AnnikaNoren/b400833c2e1fffe5a8558128acd75feb to your computer and use it in GitHub Desktop.
Save AnnikaNoren/b400833c2e1fffe5a8558128acd75feb to your computer and use it in GitHub Desktop.
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