A similar functional approach with itertools.filterfalseand itertools.countcan be
from itertools import filterfalse, count
x = next(filterfalse(f, count()))
filterfalse dropwhile, , , Python 2 3 ( rici).
from itertools import dropwhile, count
x = next(dropwhile(f, count()))