From e1a1583a32ee596ebd152d795345f6e0dbe8906b Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Mon, 23 Sep 2019 18:42:14 -0500 Subject: C O M M E N T S --- csci1913/lab1/lab2_strap012.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'csci1913/lab1') 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 -- cgit v1.2.3