Files
leetcode/520-detect-capital/520-detect-capital.py
T

13 lines
291 B
Python

class Solution(object):
def detectCapitalUse(self, word):
"""
:type word: str
:rtype: bool
"""
if word == word.upper():
return True
if word[1:] == word[1:].lower():
return True
return False