I have an array A ([1,2,3,4]) and want to define an array B with the first element the same as in A, while the rest are in the reversed order of the rest in A, ie. B=[1,4,3,2]. What I did was
A=[1,2,3,4]
B=A
C=A[1:4]
B[1:4]=C[::-1]
After executing this code, A became [1,4,3,21!! What's the problem here? How to keep the original array A?
Thanks in advance!