[Tutor] Finding the "streaks" in heads/tails list
nathan virgil
sdragon1984 at gmail.com
Fri Oct 3 14:52:05 CEST 2008
You need to store the count before resetting it since you want
> to know the largest value of count over the list. Or at least keep a
> separate max variable that you update if count > max.
>
Fairly easy:
if Cur_Count > Max_Count:
Max_Count = Cur_Count
See? Just two extra lines of code.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20081003/8cbc4723/attachment.htm>
More information about the Tutor
mailing list