Idiomatic Python: ‘times’ loop [duplicate]

You’ve already shown the idiomatic way:

for _ in range(n): # or xrange if you are on 2.X
    foo()

Not sure what is “hackish” about this. If you have a more specific use case in mind, please provide more details, and there might be something better suited to what you are doing.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)