diff options
author | RossTheRoss <mstrapp@protonmail.com> | 2019-09-23 18:38:47 -0500 |
---|---|---|
committer | RossTheRoss <mstrapp@protonmail.com> | 2019-09-23 18:38:47 -0500 |
commit | 4ca3e9f6f2fdabbc324b5914a8f1b7db7a0ed83a (patch) | |
tree | d3581ceb525626f53941d9f2a7003ffa85dbd3c8 /csci1913/lab1 | |
parent | Add VScode stuff for C O N S I S T E N C Y (diff) | |
download | homework-4ca3e9f6f2fdabbc324b5914a8f1b7db7a0ed83a.tar homework-4ca3e9f6f2fdabbc324b5914a8f1b7db7a0ed83a.tar.gz homework-4ca3e9f6f2fdabbc324b5914a8f1b7db7a0ed83a.tar.bz2 homework-4ca3e9f6f2fdabbc324b5914a8f1b7db7a0ed83a.tar.lz homework-4ca3e9f6f2fdabbc324b5914a8f1b7db7a0ed83a.tar.xz homework-4ca3e9f6f2fdabbc324b5914a8f1b7db7a0ed83a.tar.zst homework-4ca3e9f6f2fdabbc324b5914a8f1b7db7a0ed83a.zip |
Finish lab
Diffstat (limited to '')
-rw-r--r-- | csci1913/lab1/lab2_strap012.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/csci1913/lab1/lab2_strap012.py b/csci1913/lab1/lab2_strap012.py index 7fc6ff3..0aa368b 100644 --- a/csci1913/lab1/lab2_strap012.py +++ b/csci1913/lab1/lab2_strap012.py @@ -21,10 +21,13 @@ class Zillion: else: return self.List def increment(self): - newList=self.List + length = len(self.List) - 1 + newList = self.List newList[len(self.List)-1] += 1 - if newList[len(self.List)-1]>=10: - return None + if newList[length]>=10: + for n in range (0,length): + newList[length-n]=0 + newList[length-n-1]+=1 def isZero(self): for p in range (0,len(self.List)-1): if self.List[p] is not 0 or not '0': |