Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Three Words by Grimtyler
def checkio(words): #check if a string has 3 words in a row and return true if it does
#and false if it does not
list_p = words.split() #convert string to a list using split
count = 0 #counter to track alpha string count
for e in list_p: #loop through each element in list_p
if e.isalpha(): #check if current element is alphabetic
count += 1 #if true add 1 to counter
if count == 3: #check if count is equal to 3
return count == 3 #if true return bool true
else: #if current element is not alphabetic
count = 0 #set count to zero
return count == 3 #return bool false
Feb. 27, 2014