Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Bird Language by xyj784516912
def translate(text: str) -> str:
# your code here
s=""
isvow = lambda x : x in "euioay"
i = 0
while i < len(text) :
if text[i] == " " :
s+=" "
elif isvow(text[i]) :
s+=text[i]
i+=2
else :
s+=text[i]
i+=1
i+=1
return s
if __name__ == "__main__":
print("Example:")
print(translate("hieeelalaooo"))
# These "asserts" are used for self-checking and not for an auto-testing
assert translate("hieeelalaooo") == "hello"
assert translate("hoooowe yyyooouuu duoooiiine") == "how you doin"
assert translate("aaa bo cy da eee fe") == "a b c d e f"
assert translate("sooooso aaaaaaaaa") == "sos aaa"
print("Coding complete? Click 'Check' to earn cool rewards!")
Jan. 31, 2022