Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Bird Language by Andreas_Strus
VOWELS = "aeiouy"
def translation(phrase):
t = phrase [:]
for l in VOWELS:
t = t.replace(l*3, l)
t2 = t[:]
for l in range(len(t) - 1, -1, -1):
if t[l] not in VOWELS and t[l] != " ":
t2 = t2[0:l + 1] + t2[l + 1 + 1:len(t2)]
return t2
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert translation("hieeelalaooo") == "hello", "Hi!"
assert translation("hoooowe yyyooouuu duoooiiine") == "how you doin", "Joey?"
assert translation("aaa bo cy da eee fe") == "a b c d e f", "Alphabet"
assert translation("sooooso aaaaaaaaa") == "sos aaa", "Mayday, mayday"
Nov. 9, 2016