Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Striped Words by drsmith
import re
VOWELS = "AEIOUY"
CONSONANTS = "BCDFGHJKLMNPQRSTVWXZ"
def is_striped(word):
if not word.isalpha():
return False
for x, y in zip(word, word[1:]):
if x in VOWELS and y in VOWELS or x in CONSONANTS and y in CONSONANTS:
return False
return True
def checkio(text):
return sum(
is_striped(word)
for word in re.findall("\w{2,}", text.upper())
)
March 3, 2016