aboutsummaryrefslogtreecommitdiff
path: root/challenge-197/eric-cheung/python/ch-1.py
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2022-12-28 09:53:11 +0000
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2022-12-28 09:53:11 +0000
commitef1b6e72f5f8b7b06df4f7f955522b0eb7f554fd (patch)
tree95dda08c8d7524fdc19557a26af65a9c0cf9e02e /challenge-197/eric-cheung/python/ch-1.py
parentcd95529589f05076aa13fa21b8cc89a87263b90d (diff)
downloadperlweeklychallenge-club-ef1b6e72f5f8b7b06df4f7f955522b0eb7f554fd.tar.gz
perlweeklychallenge-club-ef1b6e72f5f8b7b06df4f7f955522b0eb7f554fd.tar.bz2
perlweeklychallenge-club-ef1b6e72f5f8b7b06df4f7f955522b0eb7f554fd.zip
- Added solutions by Niels van Dijke.
- Added solutions by Flavio Poletti. - Added solutions by Ali Moradi. - Added solutions by Ulrich Rieke.
Diffstat (limited to 'challenge-197/eric-cheung/python/ch-1.py')
-rwxr-xr-xchallenge-197/eric-cheung/python/ch-1.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/challenge-197/eric-cheung/python/ch-1.py b/challenge-197/eric-cheung/python/ch-1.py
new file mode 100755
index 0000000000..b84bff5774
--- /dev/null
+++ b/challenge-197/eric-cheung/python/ch-1.py
@@ -0,0 +1,10 @@
+
+import numpy as np
+
+## arrInputList = np.array([1, 0, 3, 0, 0, 5]) ## Example 1
+## arrInputList = np.array([1, 6, 4]) ## Example 2
+arrInputList = np.array([0, 1, 0, 2, 0]) ## Example 3
+
+arrOutputList = np.append(arrInputList[arrInputList != 0], arrInputList[arrInputList == 0])
+
+print (arrOutputList)