I am doing a program that changes a number in base 10 to base 7, so i did this :
num = int(raw_input(\"\")) mod = int(0) list = [] while num> 0: mod =
Use list_comprehension.
num= int(raw_input("")) mod=int(0) list =[] while num> 0: mod=num%7 num=num/7 list.append(mod) list.reverse() print ''.join([str(list[i]) for i in range (0,len(list))])