I'm writing a program to print the reverse of a given string. I am able to write the function to reverse the string but not able to take as many inputs as given in the test cases.
I've tried using "while" loop but I'm not able to get all the test cases as input. Maybe the syntax is wrong. I'm a newbie.
def rev(sample_string):
return sample_string[::-1]
t_case = int(input()) #No. of testcases
i = 0
while i < t_case:
sample_string = str(input("")) #take as many inputs as no. of
#testcases
i =+ 1
print(rev(sample_string))
for sample input: 2, ab, aba -------- output should be: ba, aba //(in separate lines)