@reagentx/

Disarium Number

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
def disarium_number(number):
    i = len(str(number))
    s = 0
    n = 0 + number
    while number:
        d = number % 10
        s += d ** i
        number //= 10
        print(d, i)
        i -= 1
    return 'Disarium !!' if s == n else 'Not !!'

print(disarium_number(89))
print(disarium_number(564))