From 4ca3e9f6f2fdabbc324b5914a8f1b7db7a0ed83a Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Mon, 23 Sep 2019 18:38:47 -0500 Subject: Finish lab --- csci1913/lab1/lab2_strap012.py | 9 ++++++--- 1 file 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': -- cgit v1.2.3