aboutsummaryrefslogtreecommitdiffstats
path: root/csci1913/lab1
diff options
context:
space:
mode:
authorRossTheRoss <mstrapp@protonmail.com>2019-09-23 18:42:14 -0500
committerRossTheRoss <mstrapp@protonmail.com>2019-09-23 18:42:14 -0500
commite1a1583a32ee596ebd152d795345f6e0dbe8906b (patch)
treea6d093562bfd56b133c4e3f80d5d6067f97ce6f2 /csci1913/lab1
parentFormat lab gooder (diff)
downloadhomework-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/lab1')
-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