[Solved] How to transform a slice to a list of index in python? [closed]
You can use the indices method of the slice to generate a tuple that can be passed to range. You need to know the length of your instance though. For example: >>> sl = slice(2) # or wherever you get…