leetcode——520. 检测大写字母

简单题

class Solution:
    def detectCapitalUse(self, word: str) -> bool:
        if word==word.upper() or word==word.lower() or word==word.title():
            return True
        else:return False
执行用时 :40 ms, 在所有 python3 提交中击败了93.12%的用户
内存消耗 :13.9 MB, 在所有 python3 提交中击败了5.26%的用户
 
                                                                  ——2019.10.18
posted @ 2019-10-18 15:40  欣姐姐  阅读(136)  评论(0编辑  收藏  举报