[Tutor] Negative step in Python slicing

Sahilpreet Singh s9814246136 at gmail.com
Fri Nov 12 09:39:49 EST 2021


Sorry I wanted to know about this
mylist[::-k]

On Fri, Nov 12, 2021, 17:56 Sahilpreet Singh <s9814246136 at gmail.com> wrote:

> Hi there,
> I am unable to understand how the following works in Python:
> mylist[::k]
> Where mylist is any iterable and k is any constant value.
> It would be very helpful if you can explain with some examples.
>


More information about the Tutor mailing list