aboutsummaryrefslogtreecommitdiff
path: root/challenge-119/abigail/python/ch-1.py
blob: 7bf1c2ff417522ed7c13b98b7c91923c648d2b19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/opt/local/bin/python

#
# See ../README.md
#

#
# Run as: python ch-1.py < input-file
#

import fileinput

for line in fileinput . input ():
    num = int (line)
    print ( (num & ~0xFF)
          | (num &  0x0F) << 4
          | (num &  0xF0) >> 4)