summaryrefslogtreecommitdiff
path: root/Problem12.py
diff options
context:
space:
mode:
Diffstat (limited to 'Problem12.py')
-rw-r--r--Problem12.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/Problem12.py b/Problem12.py
new file mode 100644
index 0000000..20847d3
--- /dev/null
+++ b/Problem12.py
@@ -0,0 +1,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")
+
+
+
+
+
+