Input output problem in python3

in a problem i am trying to get ouput after i enter my last input but in my code the ouput is shown after every test case i enter. how to solve this?

pls help in python.

This is actually the desired output in CodeChef. print after every test case.

how to achieve that? i am not able to print output after my last input.

This is a simple example to take a test case and print given integer input

for _ in range(t):

this is not working for me

You need to add indentations yourself. I’m not able to add indentations here.
You can check out the code here:

hey buddy i know this, i am trying to put up a question of which i can’t share the code beacuse its a part of long challenge.
my question is when i input only one test it works fine but when i try to enter multiple test cases it shows its ouput after every single input.
i want it to show output after the last input i give to it.

store it in a global list and then print the output.

it is preferred to give each output after every test case

can you give an example, i was trying the same?