i got TLE plz help

a = long(input())
i=0
j=0
for i in range(a):
list=[]
b = long(input())
while b>0:
var = b % 7
if var == 0:
list.append(0)

    elif var == 1:
         list.append(1)
    elif var == 2:
         list.append(2)
    elif var == 3:
         list.append(5)
    elif var == 4:
         list.append(9)
    elif var == 5:
         list.append(8)
    elif var == 6:
         list.append(6)
    b = b / 7
x=1
print ''.join([str(x) for x in list])
a = a - 1   
print"\n"

cheers,
nitin

Suggested Topics

Want to read more? Browse other topics in Python or view latest topics.