I read some Python code lines from here like below:
1 | # reverse the order of path, such that it starts with [0, 0] |
I was not quite sure about the meaning of the “[::-1] part, so I did some test and figured it out:
1 | 0, 0), (0, 1), (0, 2), (0, 3)] path = [( |
Actually that is the built-in “slice()“ function of Python:
1 | class slice(stop) |
So:
One argument, it’s “stop”.
Two arguments, they’re “start” and “stop”.
Three arguments, they’re “start”, “stop” and “step”.