Use enumerate for iterating with indices