Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

add last item of array at the first index of the array python

def add_last_item_at_first_index(arr):
    temp = arr[len(arr) - 1]
    i = 0
    while i < len(arr):
        temp1 = arr[i]
        arr[i] = temp
        temp = temp1
        i = i + 1
    return arr
 
PREVIOUS NEXT
Tagged: #add #item #array #index #array #python
ADD COMMENT
Topic
Name
2+5 =