X = [1, 2, 3, 4, 5, 6]
print(x[::-2])
The output should be = [5, 3, 1]
But the real output is = [6, 4, 2]
It seems like there is an invisible element after 6
Can anybody tell me why is that happened?
and I know if you leave the start index so it should be the first index of the list which is 0 (by default)
and if you leave the end index so it should be the last index of the list (by default) which is 5 in this case
so it means :
print(x[::-2])
should be the same as print(x[0:5:-2])
but when i try it
X = [1, 2, 3, 4, 5, 6]
print(x[0:5:-2])
output = [] => an empty list why ???