According to Create a slice using a tuple, you can do it handy way:
>>> a = range(20)
>>> b = (5, 12)
>>> a[slice(*b)]
[5, 6, 7, 8, 9, 10, 11]
But what I need is advanced ones:
a[5:]
a[:12]
a[:]
a[-1]
a[-2:]
a[:-2]
a[::-1]
How to do it with tuple and *args
?
b = (5,:)
>> File "<ipython-input-26-c4eae928199d>", line 1
>> b = (5,:)
>> ^
>>SyntaxError: invalid syntax