natas15 blind SQL injection
You code is well-written.
You may want to


add a docstring to the function
rename the loop variable i to _, since it is not being used.


You may also want to consider using itertools.repeat, which is said to be slightly faster than for _ in range(N).