Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Bird Language by zgub4
VOWELS = "aeiouy"
def translation(phrase):
final_phrase = ""
i = 0
while i < len(phrase):
if phrase[i] in VOWELS:
final_phrase += phrase[i]
i += 3
elif phrase[i].isspace():
final_phrase += phrase[i]
i += 1
else:
final_phrase += phrase[i]
i += 2
return final_phrase
if __name__ == '__main__':
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"
Oct. 22, 2017