very basic using exception handling solution in Clear category for Bird Language by lucas.stonedrake
VOWELS = "aeiouy"
lst = [list(entry) for entry in phrase.split()] #split and make a list of lists
for word in lst: # for each nested list (each word)
for x in range(len(word)): # for each letter of the word
if word[x] in VOWELS: del word[x+1:x+3] # if vowel, delete next two letters
else: del word[x+1] # if not a vowel, delete next letter
except: continue #if error, must be at end of word, so continue
#join the lists of letters then join the words with a space
return ' '.join([''.join(word) for word in lst])
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert translate("hieeelalaooo") == "hello", "Hi!"
assert translate("hoooowe yyyooouuu duoooiiine") == "how you doin", "Joey?"
assert translate("aaa bo cy da eee fe") == "a b c d e f", "Alphabet"
assert translate("sooooso aaaaaaaaa") == "sos aaa", "Mayday, mayday"
print("Coding complete? Click 'Check' to review your tests and earn cool rewards!")
Oct. 19, 2020