Untitled

 avatar
unknown
python
3 years ago
1.2 kB
12
Indexable
nums = range(100,1000)


for n1 in nums:
    for n2 in nums:
        if n1 != n2:
           
            x = n1 % 10
            if x == 0 or str(x) in str(n1)[0] or str(x) in str(n1)[1] or str(x) in str(n2):
                continue
            
            
            d3, d2, d1 = int(str(n2)[0]), int(str(n2)[1]), int(str(n2)[2])
            
            if d3 == x or d2 == x or d1 == x:
                continue
            
            s1 = d1 * n1
            if s1 > 999 or str(x) in str(s1) or s1 == 0:
                continue
            
            s2 = d2 * n1 * 10
            if s2 > 9999 or str(x) in str(s2) or s2  == 0:
                continue
                
            s3 = d3 * n1 * 100
            if s3 > 99999 or str(s3)[0] != str(x) or str(s3)[1] != str(x) or s3 == 0 or str(x) in str(s3)[2:]:
                continue
                
            my_sum = s1 + s2 + s3
            if my_sum > 99999 or str(x) in str(my_sum):
                continue
            print(n1)
            print(n2)
            print(s1)
            print(str(s2)[:-1])
            print(str(s3)[:-2])
            print(my_sum)
Editor is loading...