Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

swapping array location in python

# swaping the first and the last element
a_list = ["a", "b", "c"]
a_list[0], a_list[2] = a_list[2], a_list[0]
 
PREVIOUS NEXT
Tagged: #swapping #array #location #python
ADD COMMENT
Topic
Name
2+6 =