aboutsummaryrefslogtreecommitdiff
path: root/challenge-190/sgreen/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-190/sgreen/python/ch-1.py')
-rwxr-xr-xchallenge-190/sgreen/python/ch-1.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/challenge-190/sgreen/python/ch-1.py b/challenge-190/sgreen/python/ch-1.py
new file mode 100755
index 0000000000..54bfc62908
--- /dev/null
+++ b/challenge-190/sgreen/python/ch-1.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python3
+
+import re
+import sys
+
+
+def main(s):
+ # See if the string is all one case, or starts with a capital and then
+ # lower case letters.
+ print(1 if re.search('^[A-Z]?([A-Z]+|[a-z]+)$', s) else 0)
+
+
+if __name__ == '__main__':
+ main(sys.argv[1])