how to iterate a list in python by index