Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Bird Language by huyhoangvietha
VOWELS = "aeiouy"
def translate(text):
str = ''
vowels = 'aeiouy'
i = 0
while i < len(text):
if text[i] in vowels:
text = text[:i + 1] + text[i + 3:]
i += 1
elif text[i] != ' ':
text = text[:i + 1] + text[i + 2:]
i += 1
else:
i += 1
return text
if __name__ == '__main__':
print("Example:")
print(translate("hieeelalaooo"))
#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"
print("Coding complete? Click 'Check' to review your tests and earn cool rewards!")
Oct. 30, 2019