diff options
| author | Lubos Kolouch <lubos@kolouch.net> | 2019-12-23 19:38:58 +0100 |
|---|---|---|
| committer | Lubos Kolouch <lubos@kolouch.net> | 2019-12-23 19:38:58 +0100 |
| commit | cfe9268334182af37f4aeb8e69215b183cf5efa1 (patch) | |
| tree | dda8191ce56243317555fee82218a04c68e54b83 /challenge-040/lubos-kolouch/python/ch-1.py | |
| parent | 1899cacac7ca2813593cce58dec0fc8fb0598c97 (diff) | |
| download | perlweeklychallenge-club-cfe9268334182af37f4aeb8e69215b183cf5efa1.tar.gz perlweeklychallenge-club-cfe9268334182af37f4aeb8e69215b183cf5efa1.tar.bz2 perlweeklychallenge-club-cfe9268334182af37f4aeb8e69215b183cf5efa1.zip | |
Python solutions 040 LK
Diffstat (limited to 'challenge-040/lubos-kolouch/python/ch-1.py')
| -rw-r--r-- | challenge-040/lubos-kolouch/python/ch-1.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/challenge-040/lubos-kolouch/python/ch-1.py b/challenge-040/lubos-kolouch/python/ch-1.py new file mode 100644 index 0000000000..bebdf0e5dc --- /dev/null +++ b/challenge-040/lubos-kolouch/python/ch-1.py @@ -0,0 +1,20 @@ +#!python3 + +import numpy as np +import sys + +# python ch-1.py "[ I L O V E Y O U ][ 2 4 0 3 2 0 1 9 ][ ! ? £ $ % ^ & * ]" + +assert len(sys.argv) == 2 + +arr = np.empty(0) +arr1 = np.array(sys.argv[1].split(' ]')) + +for elem in arr1[:-1]: + arr = np.append(arr, elem[2:].split(' ')) + +arr = np.reshape(arr, (len(arr1)-1, int(len(arr)/(len(arr1)-1)))) +arr = np.rot90(arr, 3) +arr = np.flip(arr, 1) + +print(arr) |
