Comment Comment by qrian itertools.count is probably what OP is looking for parent qrian 11 months ago