Help me in solving PALIN problem

My issue

what is the error in this problem …i can’t get it. It’s showing in the input statement

cook your dish here

n=int(input())

for _ in range(n):
a,b=map(int,input().split())

for i in range(a,1000000):
    string_a=str(i)
    no_a=int(string_a[::-1])
    if(i==no_a):
        print(i)
        break
    
for i in range(b,1000000):
    string_b=str(i)
    no_b=int(string_b[::-1])
    if(i==no_b):
        print(i)
        break

My code

# cook your dish here

n=int(input())

for _ in range(n):
    a,b=map(int,input().split())

    for i in range(a,1000000):
        string_a=str(i)
        no_a=int(string_a[::-1])
        if(i==no_a):
            print(i)
            break
        
    for i in range(b,1000000):
        string_b=str(i)
        no_b=int(string_b[::-1])
        if(i==no_b):
            print(i)
            break


    

Problem Link: The Next Palindrome Practice Coding Problem

@crowd_eagle_02
the logic is make two different cases for even and odd length and then check for the left half from its right that what is the first number that u can increment . Then simply increment it and the copy paste the updated left half to the right half.
Your python code is not clear to be so that’s why i am sharing the logic.
plzz try to implement it.

Thanksss mann!