Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
bird_language solution in Clear category for Bird Language by dannedved
VOWELS = "aeiouy"
def translation(phrase):
result = phrase[0]
for v in VOWELS:
if v in phrase:
phrase = phrase.replace(v * 3, v)
for i in range(1, len(phrase)):
if phrase[i - 1] in VOWELS or not phrase[i-1].isalpha():
result += phrase[i]
return result
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"
March 29, 2019
Comments: