Help me in solving MAKEDIV3 problem

My issue

Here is my code and I fail to understand why it isn’t working:
for t in range(int(input())):
n=int(input())
for i in range((10**(n-1))+2,(10**n),3):
if i%9!=0 and i%3==0 and i%2==1:
print(i)
break

My code

for t in range(int(input())):
    n=int(input())
    for i in range((10**(n-1))+2,(10**n),3):
        if i%9!=0 and i%3==0 and i%2==1:
            print(i)
            break

Learning course: Jump from 2* to 3*
Problem Link: Make it Divisible Practice Problem in Jump from 2* to 3* - CodeChef