You can simply use slicing:

for item in I[1:]:
    print(item)

And if you want indexing, use pythonic-style enumerate:

START = 1
for index, item in enumerate(I[START:], START):
    print(item, index)
Answer from Mastermind on Stack Overflow
Discussions

Can a for loop start somewhere other than 0?
Sure, slice the list: for x in l[2:]: More on reddit.com
🌐 r/learnpython
60
113
June 21, 2022
python - Enumerate list of elements starting from the second element - Stack Overflow
There is not much merit here for using enumerate() ... you can simply .pop() the n-th item from inner lists. For loop over your data, starting at index 1 and add the 2nd value (popped) to the 1st element of the inner list: More on stackoverflow.com
🌐 stackoverflow.com
iteration - Start index for iterating Python list - Stack Overflow
What is the best way to set a start index when iterating a list in Python. For example, I have a list of the days of the week - Sunday, Monday, Tuesday, ... Saturday - but I want to iterate through... More on stackoverflow.com
🌐 stackoverflow.com
How do you start a for loop at 1 instead of 0?
Hi! I'm working on a bot to reply with suggestions for common python problems. This might not be very helpful to fix your underlying issue, but here's what I noticed about your submission: You are looping over an object using something like for x in range(len(items)): foo(item[x]) This is simpler and less error prone written as for item in items: foo(item) If you DO need the indexes of the items, use the enumerate function like for idx, item in enumerate(items): foo(idx, item) More on reddit.com
🌐 r/learnpython
16
6
November 13, 2015
🌐
DaniWeb
daniweb.com β€Ί programming β€Ί software-development β€Ί threads β€Ί 402440 β€Ί looping-through-a-list-starting-at-index-2
python - Looping through a list starting at index ... [SOLVED] | DaniWeb
December 22, 2011 - Note, indexing in Python starts at 0 - so to start at index 2 will actually mean it starts at the third element in the sequence. If you want more help, post your code. ... That's great.
Find elsewhere
🌐
Dataquest
dataquest.io β€Ί blog β€Ί python-for-loop-tutorial
Python for Loop: A Beginner's Tutorial – Dataquest
March 10, 2025 - On its first loop, Python is looking at the Tesla row. That car does have an EV range of more than 200 miles, so Python sees the if statement is True, and executes the continue nested inside that if statement, which makes it immediately jump to the next row of ev_data to begin its next loop. On the second loop, Python is looking at the next row, which is the Hyundai row.
🌐
Startcoder
startcoder.com β€Ί en β€Ί learn β€Ί python β€Ί loops β€Ί for-loop
For Loop
The second iteration of the loop starts, so the number variable is set to the second element of the array: 2.
🌐
Spark By {Examples}
sparkbyexamples.com β€Ί home β€Ί python β€Ί how to start python for loop at 1
How to Start Python For Loop at 1 - Spark By {Examples}
May 31, 2024 - You can use the Python slicing technique [start:] you can start the loop at the β€˜1’ index, it will skip the first index β€˜0’ and start the loop at index β€˜1’. If you want to use slicing to start a loop at index β€˜1’, you can slice the iterable (e.g., a list) to exclude the element at index 0.
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί python β€Ί python-for-loops
Python For Loops - GeeksforGeeks
The else block just after for/while is executed only when the loop is NOT terminated by a break statement. ... In Python, enumerate() function is used with the for loop to iterate over an iterable while also keeping track of index of each item.
Published Β  1 month ago
🌐
Python Course
python-course.eu β€Ί python-tutorial β€Ί for-loops.php
20. For Loops | Python Tutorial | python-course.eu
Introduction into loops and the for Loop in Python. Simulating C-style loops with range
🌐
Medium
medium.com β€Ί @alizek433 β€Ί looping-statements-in-python-d89df652a925
Looping Statements In Python. Introduction | by Alize Khan | Medium
January 18, 2024 - This creates a sequence of numbers from 1 to 10.The loop starts by getting the first element(2) from the list and printing that element multiplied by 2=4. It then gets the second element and that element is also multiplied by 2, and so on, until ...
🌐
SitePoint
sitepoint.com β€Ί python hub β€Ί loop lists
Python - Loop Lists | SitePoint β€” SitePoint
The for loop iterates over the elements in the order provided by the iterator. The original fruits list remains unchanged. Method 2. Using range() with a Negative Step Β· You can use range() with a step of -1 to iterate over indices from last to first. ... First argument (2): Starting index. Second argument (-1): Stopping index (exclusive). Third argument (-1): Step, moving backward. fruits[i] accesses the element at ...
🌐
The Carpentries
carpentries-incubator.github.io β€Ί python-novice-programming-gapminder β€Ί 05-loop β€Ί index.html
Repeating Actions with Loops – Programming with Python
May 20, 2025 - Suppose you have encoded a polynomial as a list of coefficients in the following way: the first element is the constant term, the second element is the coefficient of the linear term, the third is the coefficient of the quadratic term, etc. x = 5 coefs = [2, 4, 3] y = coefs[0] * x**0 + coefs[1] * x**1 + coefs[2] * x**2 print(y) ... Write a loop using enumerate(coefs) which computes the value y of any polynomial, given x and coefs. y = 0 for idx, coef in enumerate(coefs): y = y + coef * x**idx Β· Use for variable in sequence to process the elements of a sequence one at a time.
Top answer
1 of 5
7

You could hack a generator expression

def mymethod():
    return [[1,2,3,4],
            [1,2,3,4],
            [1,2,3,4],
            [1,2,3,4]]

mylist = mymethod()

for thing in (i[1] for i in mylist):
    print thing

# this bit is meant to be outside the for loop, 
# I mean it to represent the last value thing was in the for
if thing:
    print thing
2 of 5
3

If you want to get the second column of an array, you could use a list comprehension, like so:

a = [ [ 1, 2, 3, 4 ],
      [ 5, 6, 7, 8 ],
      [ 9,10,11,12 ],
      [13,14,15,16 ] ]


second_column = [ row[1] for row in a ]
# you get [2, 6, 10, 14]

You can wrap this up in a function:

def get_column ( array, column_number ):
    try:
        return [row[column_number] for row in array]
    except IndexError:
        print ("Not enough columns!")
        raise # Raise the exception again as we haven't dealt with the issue.

fourth_column = get_column(a,3)
# you get [4, 8, 12, 16]

tenth_column = get_column(a,9)
# You requested the tenth column of a 4-column array, so you get the "not enough columns!" message.

Though really, if you're working with rectangular arrays of numbers, you want to be using numpy arrays, not lists of lists of numbers.


Or, by Lattyware's implied request, a generator version:

def column_iterator ( array, column_number ):
    try:
        for row in array:
            yield row[column_number]
    except IndexError:
        print ("Not enough columns!")
        raise

Usage is just like a normal list:

>>> for item in column_iterator(a,1):
...    print(item)
... 
2
6
10
14
>>> 

The generator-nature is evident by:

>>> b = column_iterator(a,1)
>>> b.next()
2
>>> b.next()
6
>>> b.next()
10
>>> b.next()
14
🌐
Real Python
realpython.com β€Ί python-enumerate
Python enumerate(): Simplify Loops That Need Counters – Real Python
June 23, 2025 - Finally, calling next() one more ... When an iterable is used in a for loop, Python automatically calls next() at the start of every iteration until StopIteration is raised....
🌐
Reddit
reddit.com β€Ί r/learnpython β€Ί looping until the second to last element in a list, what's best practice?
r/learnpython on Reddit: Looping until the second to last element in a list, what's best practice?
January 11, 2024 -

edit: forgot to mention I want the indeces not just the items

the methods I can think of are:

for i in range(len(arr) - 1)

for i, e in enumerate(arr[:len(arr) - 1])

I know range(len(arr)) is frowned upon, but I don't see how it's worse than enumerate in this case. In fact using enumerate on a shortened list and calling len to find the second to last element of that list seems extremely clunky and far less readable.

What's the best practice for doing this?