Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Bird Language by krzysztofc10
VOWELS = "aeiouy"
def translate (phrase) :
human = ''
ignore = 0 # number of characters to ignore
for c in phrase :
if ignore > 0 :
ignore -= 1
continue
if c in VOWELS :
ignore += 2 #numb to ignore
elif c.isalpha() : # consonant
ignore += 1
human += c
return human
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"
Jan. 16, 2018