diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2019-12-23 19:05:41 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-23 19:05:41 +0000 |
| commit | 873df882a7e2c1f0718e1f9206c7f7979e80cb0f (patch) | |
| tree | 8b32c8364ea55aa3617e58871788a5e926a6cedf /challenge-040/lubos-kolouch/python/ch-1.py | |
| parent | b1b9d5071aa120c8594bb2feaa37ac3750c8a052 (diff) | |
| parent | cfe9268334182af37f4aeb8e69215b183cf5efa1 (diff) | |
| download | perlweeklychallenge-club-873df882a7e2c1f0718e1f9206c7f7979e80cb0f.tar.gz perlweeklychallenge-club-873df882a7e2c1f0718e1f9206c7f7979e80cb0f.tar.bz2 perlweeklychallenge-club-873df882a7e2c1f0718e1f9206c7f7979e80cb0f.zip | |
Merge pull request #1066 from kolcon/master
Perl solutions LK 040
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) |
