Light Mode
Dark Mode
Three Words: 'one two 3...' Test Failing

This is my code:

def checkio(words):
run = 0

for i in words.split(' '):

    for j in i:
        if j.isalpha():
            pass

        else:
            run = 0



    run += 1
    if run == 3:
        return True

return False

It is failing on the following:

assert checkio('one two 3 four five 6 seven eight 9 ten eleven 12') == False ... Fail

Why is my code turning up true when this should be false? What am I missing?

Created: Sept. 15, 2023, 5:14 p.m.
Updated: Sept. 16, 2023, 10:30 a.m.
0
7
User avatar
ejdavid