list reversal error

Steven D'Aprano steve at pearwood.info
Thu Mar 3 19:06:11 EST 2016


On Fri, 4 Mar 2016 09:51 am, vlyamtsev at gmail.com wrote:

> i have list of strings "data" and i am trying to build reverse list data1

Use a slice with a negative step-size and defaults for the start and end
positions.


data1 = data[::-1]




-- 
Steven




More information about the Python-list mailing list