Closed dsuess closed 7 years ago
Probably meant that l[:-1] gives you every item up to (and including) the second last item. This agrees with the fact that the upper index is not inclusive and -1 refers to the last item.
l[:-1]
-1
Probably meant that
l[:-1]
gives you every item up to (and including) the second last item. This agrees with the fact that the upper index is not inclusive and-1
refers to the last item.