Question: I'm trying to make a program that will check if two numbers have the same digits but in different order. For example, 232 and 223 will print "true" but 123 and 223 will print "false".
Now I have no mistakes but the answer should be "true" and it's not:

my code:

```
a=322 
b=223

list_a = list(str(a))
list_b = list(str(b))
c=len(str(a))
d=len(str(b))

j=0

if c != d:
    print "false"
else:
    for i in range(len(list_a)):
        while j<d:
           if i == list_b[j]:
            list_b.remove(list_b[j])
            break
           j=j+1
        j=0

if list_b==[]:
    print "true"

```

Answer: 
Comparing two numbers with different digits using sort():

```
 def check_different_numbers_having_same_digits(num1,num2):
            num1=[int(i) for i in str(num1)] #converting to int to list
            num1.sort()                     #sorting the list
            num2=[int(i) for i in str(num2)]
            num2.sort()
            if(num1==num2):
                return True
            else:
                return False

        print(check_different_numbers_having_same_digits(234,324))

```
I think it helps

```
    a = 323
    b = 233

    al = [c for c in str(a)]
    bl = [c for c in str(b)]

    print sorted(al) == sorted(bl)

```