aboutsummaryrefslogtreecommitdiff
path: root/challenge-009/zapwai/python/ch-1.py
blob: 7b7ab0247eafc810432f32e86f12f3f1ecb646cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
def has_distinct_digits(num):
    h = []
    h.append( num % 10 )
    num_length = len(str(num))
    while num > 0:
        num = num // 10
        h.append( num % 10 )
    h.pop()
    uniq = set(h)
    return len(uniq) == num_length;

def proc():
    for i in range(150):
        if len(str(i*i)) >= 5 and has_distinct_digits(i*i):
            print(i,"has the square:",i*i)
            break;

proc()