aboutsummaryrefslogtreecommitdiffstats
path: root/OLD
diff options
context:
space:
mode:
Diffstat (limited to 'OLD')
-rw-r--r--OLD/ee2301/collatz.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/OLD/ee2301/collatz.py b/OLD/ee2301/collatz.py
index 14873be..5f50ccc 100644
--- a/OLD/ee2301/collatz.py
+++ b/OLD/ee2301/collatz.py
@@ -1,21 +1,21 @@
-def collatzCount(number):
- for n in range (1,number+1):
+def collatzCount(k):
+ for n in range (1,k+1):
collatzConjecture(n)
- #print("\n")
+ print("\n")
def collatzConjecture(n):
- #print(n, end = ' ')
+ print(n, end = ' ')
if n is 1:
return 1
- else:
+ elif n > 1:
if n%2:
return collatzConjecture(int((n*3)+1))
else:
return collatzConjecture(int(n/2))
- raise AssertionError
+ raise AssertionError
try:
- collatzCount(10000)
+ collatzCount(100000)
except AssertionError:
print("The Collatz Conjecture is false!")