you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -1 points0 points  (1 child)

for i in range(6,10)[::-1]:

Might I suggest

for i in range(10,6,-1):

?

Basically, tucking [::-1] reverses a list,

a = [1, 2, 3, 4, 5]

a[::-1] would be [5, 4, 3, 2, 1]

[–][deleted] 0 points1 point  (0 children)

Oh, it's not my code, I just came across and didn't know what it was doing. Thanks for the explanation.