aboutsummaryrefslogtreecommitdiffstats
path: root/csci1913/lab1
diff options
context:
space:
mode:
authorRossTheRoss <mstrapp@protonmail.com>2019-09-23 18:38:47 -0500
committerRossTheRoss <mstrapp@protonmail.com>2019-09-23 18:38:47 -0500
commit4ca3e9f6f2fdabbc324b5914a8f1b7db7a0ed83a (patch)
treed3581ceb525626f53941d9f2a7003ffa85dbd3c8 /csci1913/lab1
parentAdd VScode stuff for C O N S I S T E N C Y (diff)
downloadhomework-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.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':