Generating Pythogorean triplets according to problem

Hi sir,
This is my code for the problem,
x= int(input())
for i in range(x):
t = int(input())
lis=[]
for i in range(int(t**(1/2))+1):
for j in range(i):
if (j2 + i2) == t:
lis.append(tuple(sorted((i,j))))
print(*sorted(lis))

Running this gives me wrong answer, can u please point out what i am not considering or which test case the code does not pass., and how to deal with it.

Can you share your code by saving it the given below url and then sharing the link for the same with me , so I can easily understand your code .

You dont need to make a list in order to solve this question . The problem which arises in your code is only the way the output is displayed . The output needs to be displayed in the form of - (a,b) whereas your output is in the form (a, b) the only difference is the presence of an extra space between the , and b . You can look into the given below link for a sample solution for reference -

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.