Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Bird Language by ChrisBlue
VOWELS = "aeiouy"
def translation(phrase):
import re
#vowel search and replace
for x in VOWELS:
phrase = re.sub("("+x+"){3,3}",r"\1",phrase)
print(phrase)
#consonant search and replace
phrase = re.sub("([^aeiouy ])(.)",r"\1",phrase)
print(phrase)
return phrase
if __name__ == '__main__':
print("Example:")
print(translate("hoooowe yyyooouuu duoooiiine"))
#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"
print("Coding complete? Click 'Check' to review your tests and earn cool rewards!")
May 15, 2020
Comments: