Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Not my best solution in Uncategorized category for Three Words by ROBCHI
# migrated from python 2.7
def checkio(words):
changed = words.split()
countA = 0.5
countB = 0
end_total = countA
if len(changed) <= 2:
return False
for x in changed:
if x.isalpha():
countA += 1
if countA >= 3:
return True
if x.isdigit():
countA = 0
countB += 1
if countB == len(changed):
return False
if countA >= 0 and countA < 3:
return False
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"
Feb. 27, 2014