reveres the array

rajeevsinghthakur · September 21, 2021 · Python
def reversedArray(A,start,end):
    while start<end:
        A[start],A[end] = A[end],A[start]
        start += 1
        end -= 1
        
A = [1,2,3,4,5,6]

reversedArray(A,0,5)

print(A)
    

Comments

Please sign up or log in to contribute to the discussion.