4 ms·
So you're saying a negative index value should work like a count of elements to return and not an index? Then you couldn't do thing like l[-4:-2] to get a rang
by UncleEntity 2y ago
So you're saying a negative index value should work like a count of elements to return and not an index?
Then you couldn't do thing like l[-4:-2] to get a range of elements which seems slightly useful.
- pansa2 2y agoNo - negative indexing is fine as it is. You just need to be careful about the special case of negative zero.