walk through a python list backward with bitwise negation:

>>> L = ["first", "second", "third", "second-last", "last"]
>>> L[0]
'first'
>>> L[~0]
'last'
>>> L[~1]
'second-last'
>>> L[~2]
'third'

Sign in to participate in the conversation
Fosstodon

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.