My issue
import random
for _ in range(int(input())):
x=int(input())
while x!=0:
r=random.randint(10**(x-1),10**x)
if r%3==0 and r%9!=0 and r%2!=0:
print(r)
break
can anyone tell why this approach is wrong pls?
My code
import random
for _ in range(int(input())):
x=int(input())
while x!=0:
r=random.randint(10**(x-1),10**x)
if r%3==0 and r%9!=0 and r%2!=0:
print(r)
break
Learning course: Jump from 2* to 3*
Problem Link: Make it Divisible Practice Problem in Jump from 2* to 3* - CodeChef