diff options
Diffstat (limited to 'challenge-120/abigail/python/ch-1.py')
| -rw-r--r-- | challenge-120/abigail/python/ch-1.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/challenge-120/abigail/python/ch-1.py b/challenge-120/abigail/python/ch-1.py new file mode 100644 index 0000000000..510ce33d10 --- /dev/null +++ b/challenge-120/abigail/python/ch-1.py @@ -0,0 +1,16 @@ +#!/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 & 0x55) << 1 + | (num & 0xAA) >> 1) |
