diff options
author | RossTheRoss <msattr@gmail.com> | 2019-10-15 10:57:11 -0500 |
---|---|---|
committer | RossTheRoss <msattr@gmail.com> | 2019-10-15 10:57:11 -0500 |
commit | ebe9d7d0455010d9456fb336a3637ddfbdb48bcd (patch) | |
tree | 1b35541d5901f3a6eed0d2f53fcd46bfebf56233 | |
parent | THat was fun I guess (diff) | |
download | homework-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.py | 4 |
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)) |