Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Creative category for Striped Words by mastak
# migrated from python 2.7
import re
DICTIONARY = [
"AEIOUY",
"BCDFGHJKLMNPQRSTVWXZ"
]
def condition(x):
current = x[0].upper() in DICTIONARY[1]
for item in x:
if item.upper() not in DICTIONARY[current]:
return False
current = not current
return len(x) > 1
def checkio(text):
return len(list(filter(condition, re.findall(r"[\w']+", text))))
March 19, 2014
Comments: