summaryrefslogtreecommitdiff
path: root/Problem12.py
blob: 20847d3bdda668c2d789d4ee2ead8da70db16c41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
def divisorcountover500(n):
    divisors = 2
    for x in range(2,int(n/2)+1):
        if n % x == 0:
            divisors+=1
    print(divisors)
    if divisors > 500:
        return True
    return False
        

triangleNum, count = 1 , 1
while divisorcountover500(triangleNum) == False:
    count+=1
    triangleNum+=count
print(triangleNum)
k=input("press close to exit")