- 3

Does slicing exclude

Eg : [0:10] #is 10 excluded while excluding

2nd Aug 2021, 4:23 AM
Jprogsie
Jprogsie - avatar
6 Antworten
+ 4
No it's exclusive, [ 0 : 10 ] goes from 0 to 9.
2nd Aug 2021, 4:26 AM
Ipang
+ 7
Wayne , why don't you do a try by yourself? it's just to write one line of code like: print([1,2,3,4][0:3]) # result is: [1, 2, 3]
2nd Aug 2021, 6:13 AM
Lothar
Lothar - avatar
+ 3
Yes, 10 is excluded. This slice will include elements 0 through to 9 and exclude element 10
2nd Aug 2021, 4:48 AM
David Akhihiero
David Akhihiero - avatar
+ 2
Inclusive = Include both range bounds. Exclusive = Include range lower bound, but exclude upper bound.
2nd Aug 2021, 5:58 AM
Ipang
+ 1
Yeah that's what I mean what does exclude means then can ya tell me🤔🤔🤔🤔🤔
2nd Aug 2021, 4:30 AM
Jprogsie
Jprogsie - avatar
- 1
Yeah I tested that bro
2nd Aug 2021, 6:21 AM
Jprogsie
Jprogsie - avatar