:type word: str :rtype: bool
(self, word)
| 45 | |
| 46 | class Solution(object): |
| 47 | def detectCapitalUse(self, word): |
| 48 | """ |
| 49 | :type word: str |
| 50 | :rtype: bool |
| 51 | """ |
| 52 | if len(word) < 2: |
| 53 | return True |
| 54 | |
| 55 | letter_one = ord(word[0]) |
| 56 | # letter_two = word[1] |
| 57 | if 65 <= letter_one <= 90: |
| 58 | return self.letter_all_capital_or_lower(word[1:]) |
| 59 | |
| 60 | return self.letter_all_lower(word[1:]) |
| 61 | # for i in word: |
| 62 | |
| 63 | def letter_all_capital_or_lower(self, word): |
| 64 | # |
nothing calls this directly
no test coverage detected