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

猜你喜欢

转载自www.cnblogs.com/taoyuxin/p/11698657.html