aboutsummaryrefslogtreecommitdiff
path: root/challenge-258/sgreen/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-258/sgreen/python/ch-1.py')
-rwxr-xr-xchallenge-258/sgreen/python/ch-1.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/challenge-258/sgreen/python/ch-1.py b/challenge-258/sgreen/python/ch-1.py
new file mode 100755
index 0000000000..caab0a1a85
--- /dev/null
+++ b/challenge-258/sgreen/python/ch-1.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+
+import sys
+
+
+def count_even_digits(ints: list) -> int:
+ return sum(1 for i in ints if len(str(i)) % 2 == 0)
+
+
+def main():
+ # Convert input into integers
+ array = [int(n) for n in sys.argv[1:]]
+ result = count_even_digits(array)
+ print(result)
+
+
+if __name__ == '__main__':
+ main()