Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion stream_exercise.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


import pdb
class StreamProcessor(object):
"""
Write a stream processor class that does the following:
Expand Down Expand Up @@ -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
Expand Down