Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. def decrypt(word):
  2. """
  3. Enter your function docstring here
  4. parameters: word (string)
  5. """
  6. # decrypt a single word from the secret language
  7. if word[0] in ('a', 'e', 'i', 'o', 'u') and word[-3:] == 'tan':
  8. word_sans_tan = word[:-3]
  9. return word_sans_tan
  10. elif word[0] not in ('a', 'e', 'i', 'o', 'u') and word[-3] == 'est':
  11. word_sans_est = word[-4] + word + word[-4:]
  12. return word_sans_est
  13. else:
  14. # If the word is not a valid word in the secret language, return None
  15. print('None, invalid message')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement