Skip to content

Commit 991f155

Browse files
committed
programming 520 added
1 parent 2af5b29 commit 991f155

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

programming-py/520.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def detect_capital_use(word):
2+
return word == word.lower() or word == word.upper() or (word[0].isupper() and word[1::].islower())
3+
4+
5+
# test below
6+
print(detect_capital_use("USA"))
7+
print(detect_capital_use("FlaG"))

0 commit comments

Comments
 (0)