Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Bird Language by Stanislaw_Szataniak
VOWELS = "aeiouy"
def is_v(a):
for i in VOWELS:
if a == i:
return True
return False
def translate(phrase):
i = 0
s=""
while i < len(phrase):
if phrase[i] == " ":
s+=" "
elif is_v(phrase[i]):
s+=phrase[i]
i+=2
else:
s+=phrase[i]
i+=1
i+=1
return s
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"
Nov. 19, 2016