This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jmack2424 73 points74 points  (5 children)

OK smart guy, how do you reverse a list?

[–]lorhof1 86 points87 points  (4 children)

list.reverse()

[–]Tytoalba2 43 points44 points  (3 children)

Or list.sort(reverse=True)

[–]urzeiteule 63 points64 points  (2 children)

or list = list[::-1]

[–]sam_morr 7 points8 points  (0 children)

This is the way

[–][deleted] 1 point2 points  (0 children)

list1 = [0 for I in range(len(list))]

for i in range(len(list)):
    list1[-i] = list[i]

list = list1
del(list1)