aboutsummaryrefslogtreecommitdiff
path: root/challenge-130/abigail/python/ch-1.py
blob: f102e20ac9049eddcadc0783038c4b79c0b182b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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)