class Solution(object):
def detectCapitalUse(self, word):
"""
:type word: str
:rtype: bool
"""
word_temp = word[
1:];
if (word.lower() == word):
return True;
if (word.upper() == word):
return True;
if (len(word)>
1 and (word_temp.lower() == word_temp)
and (word[
0].upper() == word[
0])):
return True;
else:
return False;
def detectCapitalUse(self, word):
return word.isupper()
or word.islower()
or word.istitle();