diff options
| author | Abigail <abigail@abigail.be> | 2021-07-05 14:38:06 +0200 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2021-07-05 14:38:06 +0200 |
| commit | 78c841faea1060a3b7ea63a4316e461e490d275e (patch) | |
| tree | 92a3b40da3986775fbf1441d6424f720cbe6e3df /challenge-120/abigail/python/ch-1.py | |
| parent | c79281808d6b8968f5bd105536df88b345bded7d (diff) | |
| download | perlweeklychallenge-club-78c841faea1060a3b7ea63a4316e461e490d275e.tar.gz perlweeklychallenge-club-78c841faea1060a3b7ea63a4316e461e490d275e.tar.bz2 perlweeklychallenge-club-78c841faea1060a3b7ea63a4316e461e490d275e.zip | |
Solutions in 15 languages for week 120, part 1.
This is basically the same as last weeks challenge...
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) |
