In a Python for loop that iterates over a list we can write: ... The pythonic way is to use enumerate : for idx ...
stackoverflow.com