0
About negative slicelist
Idk
8 Réponses
+ 5
nita koni best way to learn is to experiment
https://code.sololearn.com/cXNzv56rgiyL
+ 1
What exactly is your question???
+ 1
i am japanese but studying.nice ti meet you.thnx
+ 1
In python slicing is just
newlist=oldlist[startindex:endindex:stepsize]
If an index is negative it is index from the end:
If there is a gap between two : it is set on standard
If the list has the length 5 then -1 stands for the last element and -2 for the second last element...
If stepsize is negative it slices to the left and not to the right....
+ 1
koni nita The example [1::-2:5] has to many :
[1:-2:5] means starting at the Element with index 1, taking every 5th Element and stoping at the second last element
"0123456789“[1:-2:5] would result in „16“
0
[1::-2:5]?
0
idk.very difficult.
0
tthnx