Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Striped Words by popomin
vowels = {'a', 'e', 'i', 'o', 'u', 'y'}
cons = {'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'z'}
import re
def checkio(text):
word_list = re.findall(r"([\w]{2,})+",text.lower())
count = 0
for word in word_list:
count += 1 if set(word[::2]) <= vowels and set(word[1::2]) <= cons else 0
count += 1 if set(word[1::2]) <= vowels and set(word[::2]) <= cons else 0
return count
Dec. 17, 2017
Comments: