About negative slicelist | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

About negative slicelist

Idk

20th May 2020, 11:31 AM
koni nita
koni nita - avatar
8 Answers
+ 5
nita koni best way to learn is to experiment https://code.sololearn.com/cXNzv56rgiyL
20th May 2020, 1:07 PM
David Ashton
David Ashton - avatar
+ 1
What exactly is your question???
20th May 2020, 11:32 AM
Alexander Thiem
Alexander Thiem - avatar
+ 1
i am japanese but studying.nice ti meet you.thnx
20th May 2020, 11:37 AM
koni nita
koni nita - avatar
+ 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....
20th May 2020, 11:39 AM
Alexander Thiem
Alexander Thiem - avatar
+ 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“
20th May 2020, 11:42 AM
Alexander Thiem
Alexander Thiem - avatar
0
[1::-2:5]?
20th May 2020, 11:37 AM
koni nita
koni nita - avatar
0
idk.very difficult.
20th May 2020, 12:52 PM
nita koni
0
tthnx
20th May 2020, 3:55 PM
koni nita
koni nita - avatar