aboutsummaryrefslogtreecommitdiffstats
path: root/ee2301
diff options
context:
space:
mode:
authorRossTheRoss <msattr@gmail.com>2019-10-15 10:57:11 -0500
committerRossTheRoss <msattr@gmail.com>2019-10-15 10:57:11 -0500
commitebe9d7d0455010d9456fb336a3637ddfbdb48bcd (patch)
tree1b35541d5901f3a6eed0d2f53fcd46bfebf56233 /ee2301
parentTHat was fun I guess (diff)
downloadhomework-ebe9d7d0455010d9456fb336a3637ddfbdb48bcd.tar
homework-ebe9d7d0455010d9456fb336a3637ddfbdb48bcd.tar.gz
homework-ebe9d7d0455010d9456fb336a3637ddfbdb48bcd.tar.bz2
homework-ebe9d7d0455010d9456fb336a3637ddfbdb48bcd.tar.lz
homework-ebe9d7d0455010d9456fb336a3637ddfbdb48bcd.tar.xz
homework-ebe9d7d0455010d9456fb336a3637ddfbdb48bcd.tar.zst
homework-ebe9d7d0455010d9456fb336a3637ddfbdb48bcd.zip
Help
Diffstat (limited to '')
-rw-r--r--ee2301/collatz.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ee2301/collatz.py b/ee2301/collatz.py
index d8d1ab8..acbc12e 100644
--- a/ee2301/collatz.py
+++ b/ee2301/collatz.py
@@ -1,5 +1,5 @@
def collatzCount(number):
- for n in range (1,number):
+ for n in range (1,number+1):
collatzConjecture(n)
print("\n")
@@ -8,7 +8,7 @@ def collatzConjecture(n):
if n is 1:
return 1
else:
- if (n%2):
+ if n%2:
return collatzConjecture(int((n*3)+1))
else:
return collatzConjecture(int(n/2))