aboutsummaryrefslogtreecommitdiff
path: root/challenge-130/abigail/python
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-130/abigail/python')
-rw-r--r--challenge-130/abigail/python/ch-1.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/challenge-130/abigail/python/ch-1.py b/challenge-130/abigail/python/ch-1.py
new file mode 100644
index 0000000000..f102e20ac9
--- /dev/null
+++ b/challenge-130/abigail/python/ch-1.py
@@ -0,0 +1,23 @@
+#!/opt/local/bin/python
+
+#
+# See ../README.md
+#
+
+#
+# Run as: python ch-1.py < input-file
+#
+
+import fileinput
+import re
+
+for line in fileinput . input ():
+ numbers = {}
+ for x in re . findall ('[1-9][0-9]*', line):
+ if x in numbers:
+ numbers [x] = numbers [x] + 1
+ else:
+ numbers [x] = 1
+ for number in numbers:
+ if numbers [number] % 2 == 1:
+ print (number)