Light Mode
Dark Mode
Problem with some code
def checkio(text):
    count=0
    for x in text.split():
        if x.isalpha():
            count += 1
            if count ==3:
                return True
            else:
                return False

There is a problem in this code.It returned true before adding the last else statement when I passed ("Hello World hello") but when I added the the (else) it returned false and didn't work.

Can I know how to make it run properly and the reason for the problem?

Created: Dec. 28, 2019, 12:59 p.m.
Updated: Dec. 28, 2019, 3:45 p.m.
-1
8
User avatar
Mohamed_A._Stohy