Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import time
number = int(input("Number: "))

i = 1
divs = 0

x = int((number ** (1/2)) * 10)


start_time = time.time()


def stamp():
    t = time.time() - start_time
    print("Time Elapsed: {:d}ms|{:d}s".format(round(t * 1000), round(t * 1)))


print("-----STARTED-----")

for i in range(x):
    i += 1
    numdiv = number / i
    numd = str(numdiv)
    numbd = numd[-1]
    numbd = int(numbd)
    if numdiv < number ** (1/2):
        print("-----FINISHED-----")
        stamp()
        print("Results:", divs)
        break
    if numbd == 0:
        print('DIVISIBLE BY', int(numdiv), '*', int(i))
        divs += 1