I am new to Python and trying to do something I do often in Ruby. Namely, iterating over a set of indices, using them as argument to function and comparing its results with an a
If Your question is regarding, when you are solving the problem on competitive places like hackerrank or anywhere else. If they have not provided their environment to run test cases in a loop.
And locally if You are running code for python compiler It would be useful.
you can simply use a while loop or range function of python.
e.g:
t = int(input("Enter Number of testcases"))
type(t)
while(t!=0):
n = int(input("Enter number of data"))
type(n)
// Code logic or function Call
t = t-1