Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def decrypt(word):
- """
- Enter your function docstring here
- parameters: word (string)
- """
- # decrypt a single word from the secret language
- if word[0] in ('a', 'e', 'i', 'o', 'u') and word[-3:] == 'tan':
- word_sans_tan = word[:-3]
- return word_sans_tan
- elif word[0] not in ('a', 'e', 'i', 'o', 'u') and word[-3] == 'est':
- word_sans_est = word[-4] + word + word[-4:]
- return word_sans_est
- else:
- # If the word is not a valid word in the secret language, return None
- print('None, invalid message')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement