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