So I have
A = [1,2,3,4]
I want to check if the array is symmetric. So the output would be False
Another example would be
arr = [1,2,3,3,2,1]
out = fun(arr)
out = True
I have been trying by like
def checksymm(a):
flag = 0
for i in range(0,len(a)/2):
if np.abs(a[i]) == np.abs(a[-i]):
return True
else:
return False
What can I be doing wrong? Thanks.
np.abshere?