Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python swap two values in list

a_list = ["a", "b", "c"]
a_list[0], a_list[2] = a_list[2], a_list[0]
print(a_list) # ["c", "b", "a"]
Source by www.kite.com #
 
PREVIOUS NEXT
Tagged: #python #swap #values #list
ADD COMMENT
Topic
Name
5+9 =