A simple way to make repeated "back rows"

Sometimes I usually do next next a (repeatedly) to get a specific item. This works well when you need 2 or less workarounds. However, it is becoming rather cumbersome. For this simple case, the cycle is too complicated.

Fortunately, you can do at series pos in some cases if you know the position.

When it comes to removing redundancy for the inverse function, aka back , this doesn't work either.

Preferably, I want to do something like at , but relative to the current position in the series

+5
source share
1 answer

skip allows you to move forward or backward from the current position in the series.

 >> series: [ 1 2 3 4 5 6] == [1 2 3 4 5 6] >> series: skip series 2 == [3 4 5 6] >> series: skip series 3 == [6] >> series: skip series -3 == [3 4 5 6] 
+6
source

Source: https://habr.com/ru/post/1269815/


All Articles