You can iterate a slice of your data and start the enumeration at a specific integer:
start_at = 1
elements = ('foo', 'bar', 'baz')
for count, elem in enumerate(elements[start_at:], start_at):
print (count, elem)
Output:
1 bar
2 baz
Documentation:
Edit:
If you are working with non-sliceable iterators you have to work around it:
start_at = 3 # first one included (0 based)
stop_at = 5 # last one (not included)
elements = ('foo', 'bar', 'baz', 'wuzz', 'fizz', 'fizzbuzz', 'wuzzfizzbuzz', 'foobarfuzzbizzwuzz')
# skip first few
it = iter(elements)
for _ in range(start_at):
print("skipping: ", next(it)) # dont print, simply: next(it)
# enumerate the ones you want
i = start_at
for _ in range(stop_at-start_at):
print(i,next(it)) # you might need a try: except StopIteration:
i+=1
to get:
skipping: foo
skipping: bar
skipping: baz
3 wuzz
4 fizz
5 fizzbuzz