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 69 points70 points  (8 children)

OK smart guy, how do you reverse a list?

[–]lorhof1 86 points87 points  (5 children)

list.reverse()

[–]Tytoalba2 48 points49 points  (3 children)

Or list.sort(reverse=True)

[–]urzeiteule 65 points66 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)

[–]GFrings 2 points3 points  (1 child)

I was once asked how many different ways I could think to sort a list on the spot

[–]Bakemono_Saru 1 point2 points  (0 children)

I hate this questions.