VOWELS = ['a','e','i','o','u','y']
def translate(phrase):
s=str()
i=0
while i in range(len(phrase)-1):
if phrase[i].isalpha:
if phrase[i] in VOWELS:
s+=phrase[i]
i+=3
else:
s+=phrase[i]
i+=2
else:
s+=phrase[i]
i+=1
return s
RESULT
- translate("hieeelalaooo") == "hello" -------------------------- ##Yes!!!
- translate("hoooowe yyyooouuu duoooiiine") == "how youdoin" ---- ##???
- translate("aaa bo cy da eee fe") == "a oyaef" ----------------- ##???
- translate("sooooso aaaaaaaaa") == "sos aaa" ------------------- ##Yes!!!
Created at: 2019/09/03 15:49; Updated at: 2019/09/03 19:29
The question is resolved.