Easy Python If Statement


  • 0
    B

    Could use an or to condense this, but just to be 100% clear about what is going on:

            if word == word.lower():
                return True
            elif word == word.upper():
                return True
            elif word == word.title():
                return True
            else:
                return False
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.