Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Bird iteration solution in Clear category for Bird Language by sinclair2k
VOWELS = "aeiouy"
def translation(phrase):
i = iter(phrase)
res = []
for c in i:
res.append(c)
if c != ' ' :
next(i)
if c in VOWELS:
next(i)
return ''.join(res)
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"
July 6, 2018