Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Swap 2 items of a list in python

in python below is how you swap 2 elements of list
            x[i+1],x[i]=x[i],x[i+1]
Don't use function swap(user defined or pre-defined)
Source by www.kite.com #
 
PREVIOUS NEXT
Tagged: #Swap #items #list #python
ADD COMMENT
Topic
Name
4+8 =