Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Striped Words solution in Clear category for Striped Words by mz97
VOWELS = "AEIOUY"
CONSONANTS = "BCDFGHJKLMNPQRSTVWXZ"
def checkio(text):
text=text.upper()
vow=0; con=0; s=0; er=0; k=0; a=0;
for x in text:
if VOWELS.rfind(x)==-1 and CONSONANTS.rfind(x)==-1:
vow=0
con=0
if er==1:
er=0
elif x.isdigit() == True:
er=1
elif a==1 and k>1:
s=s+1
a=0
k=0
elif VOWELS.rfind(x)!=-1 and vow==0:
vow=1
con=0
a=1
k=k+1
elif CONSONANTS.rfind(x)!=-1 and con==0:
vow=0
con=1
a=1
k=k+1
elif VOWELS.rfind(x)!=-1 and vow==1:
er=1
a=0
elif CONSONANTS.rfind(x)!=-1 and con==1:
er=1
a=0
if a==1 and k>1 and er==0:
s=s+1
return s
Oct. 14, 2016