Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Three words solution in Clear category for Three Words by Seaclaid
def checkio(words):
all=words.isalnum()
list=words.split()
print("***",all,len(list),list)
if len(list)<3:
print("end ",False)
return False
else:
print("ciąg stringów >=3")
if all==True:
print("end ",False)
return False
else:
print(list)
tf=[]
for i in range(len(list)):
tf=tf+[list[i].isdigit()]
print(tf)
for i in range(len(tf)-2):
if tf[i]==False and tf[i]==tf[i+1] and tf[i]==tf[i+2]: #and tf==False:
print("end ",True)
return True
else:
print("szukamy dalej")
print("end ",False)
return False
#These "asserts" using only for self-checking and not necessary for auto-testing
if __name__ == '__main__':
assert checkio("Hello World hello") == True, "Hello"
assert checkio("He is 123 man") == False, "123 man"
assert checkio("1 2 3 4") == False, "Digits"
assert checkio("bla bla bla bla") == True, "Bla Bla"
assert checkio("Hi") == False, "Hi"
Jan. 16, 2017