diff --git a/stream_exercise.py b/stream_exercise.py index c0cf5a5..2e7acb8 100644 --- a/stream_exercise.py +++ b/stream_exercise.py @@ -1,5 +1,5 @@ - +import pdb class StreamProcessor(object): """ Write a stream processor class that does the following: @@ -56,6 +56,15 @@ def process(self): # together. total = 0 # The running total of sums. + while count < 10 and total < 200: + # pdb.set_trace() + digits = self._stream.read(2) + if digits == '' or len(digits) < 2: + break + + count = count + 1 + total = total + int(digits) + # TODO: WRITE CODE HERE: # Just some example syntax, you can read two digits from the head of the