Skip to content

Instantly share code, notes, and snippets.

@munguial
Created August 6, 2020 05:20
Show Gist options
  • Save munguial/8a3dbd47b4dc8709fdf5329a9e470c3a to your computer and use it in GitHub Desktop.
Save munguial/8a3dbd47b4dc8709fdf5329a9e470c3a to your computer and use it in GitHub Desktop.
August - Day 1 - Detect Capital
class Solution:
def detectCapitalUse(self, word: str) -> bool:
if word.lower() == word:
return True
if word[0].upper() + word[1:].lower() == word:
return True
if word.upper() == word:
return True
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment