On Dec 24, 2012, at 0:20 AM, Litvin wrote: > Or just replace > > while d == d1: > with > while d == d1 and n > 0: > or replace the "while" with a "while True" and a if n==0: raise StopIteration bb -- Brian Blais bblais at gmail.com http://web.bryant.edu/~bblais http://brianblais.wordpress.com/