I want to split the array at a point s and add it to the end of the array. But my output is my input list.
def split_and_add(arr, s):
n = len(arr)
if n >= s or s <=0:
return arr
else:
end = []
for i in range(0,s):
end = end + [arr[i]]
start = []
for i in range(s,n):
start = start + [arr[i]]
return start + end
print(split_and_add([1,2,3,4,5,6],3))
The output is still [1,2,3,4,5,6]. Could somebody help?