Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Bird Language by ppitek40
VOWELS = "aeiouy"
def translation(phrase):
wynik = ""
lista = []
for i in phrase:
lista.append(i)
for i in range(len(lista)):
if lista[i] != " ":
if lista[i] in VOWELS and i < len(lista) - 2:
if lista[i] == lista[i+1] and lista[i+1] == lista[i+2]:
wynik = wynik + lista[i]
lista[i+2] = "0"
lista[i+1] = "0"
else:
if lista[i] not in VOWELS and lista[i] != "0":
wynik = wynik + lista[i]
else:
wynik = wynik + " "
return wynik
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"
Dec. 22, 2017