SyntaxFix
Write A Post
Hire A Developer
Questions
This is lighter weight than xrange (and the while loop) since it doesn't even need to create the int objects. It also works equally well in Python2 and Python3
xrange
int
from itertools import repeat for i in repeat(None, 10): do_sth()