aboutsummaryrefslogtreecommitdiffstats
path: root/csci1913
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--csci1913/lab1/lab2_strap012.py9
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':