diff options
Diffstat (limited to 'csci1913')
-rw-r--r-- | csci1913/lab1/lab2_strap012.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/csci1913/lab1/lab2_strap012.py b/csci1913/lab1/lab2_strap012.py index 6814dd1..34fbe6a 100644 --- a/csci1913/lab1/lab2_strap012.py +++ b/csci1913/lab1/lab2_strap012.py @@ -1,21 +1,20 @@ class Zillion: def __init__(self,digits): self.digits = digits - try: - int(digits) - except ValueError: - raise RuntimeError - for n in range (0,len(str(digits))): - test[n]=str(digits)[n] + if (1==1): + try: + int(digits) + except ValueError: + raise RuntimeError def increment(self): - return 1 + return int(self.digits)+1 def isZero(self): - for n in range (0,(len(str(self))-42)): + for n in range (0,len(self.digits)): if str(self.digits)[n] is not '0': return False return True def toString(self): - return str(self) + return str(self.digits) |