Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

reverse list python

the_list = [1,2,3]
reversed_list = the_list.reverse()
list(reversed_list) # will return [3,2,1]

# OR, better

the_list = [1,2,3]
the_list[::-1] # will also return [3,2,1]
 
PREVIOUS NEXT
Tagged: #reverse #list #python
ADD COMMENT
Topic
Name
3+2 =