Guided Project Profitable Apps Screen 6/14

Screen Link: Learn data science with Python and R projects

My Code:

 def english(a):
    non_english = 0
    for character in a:
        if ord(character) > 127:
            non_english += 1
        
        if non_english > 3:
            return False
        else:
            return True

print (english ('Instagram'))
print (english ('爱奇艺PPS -《欢乐颂2》电视剧热播'))
print (english ('Docs To Go™ Free Office Suite'))
print (english ('Instachat 😜'))

What I expected to happen:
True
True
False
True

What actually happened:

True
True
True
True

I wrote a code to check if the name of an app contains more than three non-English characters. I was expecting to see False printed in the third row but that was also returned as True. Can someone help with this?

Thanks!

Hello @amynahreimoo

Your second if statement is wrongly indented. It is indented within in the for loop causing the function to not work properly.