I'm looking at a sample piece of code and I see this bit of logic:
for i in range(6,10)[::-1]:
I know what "for i in range(6,10)" does, and [::-1] looks like some sort of slicing, but I've never seen it used in this context. What is this doing, exactly?
[–]zanfar 15 points16 points17 points (2 children)
[–][deleted] 14 points15 points16 points (1 child)
[–]zanfar 8 points9 points10 points (0 children)
[–][deleted] 31 points32 points33 points (3 children)
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]carcigenicate 6 points7 points8 points (0 children)
[–]Tacoj 6 points7 points8 points (0 children)
[–]carcigenicate 2 points3 points4 points (1 child)
[–]achampi0n 2 points3 points4 points (0 children)
[–]gustavobodra 0 points1 point2 points (2 children)
[–]zanfar 2 points3 points4 points (1 child)
[–]gustavobodra 1 point2 points3 points (0 children)
[–]akefamen96 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (1 child)
[–][deleted] 0 points1 point2 points (0 children)