I have learned Python
for about 4 months, I thought I know every basics now. But currently I accidently tried a simple python expression, and the result is out of my expectation.
for example:
test = [1,2,3,4]
test[0:-1:-1]
and the result is an empty list([]
).
However, my expected result is [3,2,1]
for "test[::-1]"
will output "[4,3,2,1]"
.
Can anyone tell me why?