3 ms·When you want to quickly slice off the first and last elements of a list?by tomrod 9y agoWhen you want to quickly slice off the first and last elements of a list?kmill 9y agoIf it's a list (and not a generator like `range`), then `l[1:-1]` will do.tomrod 9y agoOf course. Consider though: a, b, c = (l[0], l[1:-1], l[-1]) is also feasible, but I think it adds a bit of overhead