Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Striped Words by Moff
import re
def is_striped(w):
if any(c in '0123456789' for c in w):
return False
w = w.upper()
c = w[0]
flag = c in 'AEIOUY'
for c in w[1:]:
f = c in 'AEIOUY'
if flag == f:
return False
flag = not flag
return True
def checkio(text):
return sum(1 for w in re.findall('(\w\w+)', text) if is_striped(w))
July 22, 2015