diff options
author | RossTheRoss <mstrapp@protonmail.com> | 2019-09-23 18:42:14 -0500 |
---|---|---|
committer | RossTheRoss <mstrapp@protonmail.com> | 2019-09-23 18:42:14 -0500 |
commit | e1a1583a32ee596ebd152d795345f6e0dbe8906b (patch) | |
tree | a6d093562bfd56b133c4e3f80d5d6067f97ce6f2 /csci1913 | |
parent | Format lab gooder (diff) | |
download | homework-e1a1583a32ee596ebd152d795345f6e0dbe8906b.tar homework-e1a1583a32ee596ebd152d795345f6e0dbe8906b.tar.gz homework-e1a1583a32ee596ebd152d795345f6e0dbe8906b.tar.bz2 homework-e1a1583a32ee596ebd152d795345f6e0dbe8906b.tar.lz homework-e1a1583a32ee596ebd152d795345f6e0dbe8906b.tar.xz homework-e1a1583a32ee596ebd152d795345f6e0dbe8906b.tar.zst homework-e1a1583a32ee596ebd152d795345f6e0dbe8906b.zip |
C O M M E N T S
Diffstat (limited to 'csci1913')
-rw-r--r-- | csci1913/lab1/lab2_strap012.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/csci1913/lab1/lab2_strap012.py b/csci1913/lab1/lab2_strap012.py index 8c5798e..4e154f7 100644 --- a/csci1913/lab1/lab2_strap012.py +++ b/csci1913/lab1/lab2_strap012.py @@ -5,7 +5,7 @@ class Zillion: self.toList() def toList(self): - badBoolean=False + badBoolean=False #Kludge if len(self.digits) == 0 : raise RuntimeError #Cannot make a list of nothing for n in range (0,len(self.digits)): @@ -26,21 +26,21 @@ class Zillion: length = len(self.List) - 1 newList = self.List newList[len(self.List)-1] += 1 - if newList[length]>=10: + if newList[length]>=10: #Loop to increment all 10s to 0s with carry 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': + if self.List[p] is not 0: return False return True - + def toString(self): string='' for q in range (0,len(self.List)): - string+=str(self.List[q]) + string+=str(self.List[q]) #Make string by concatenation return string |