On Tue, 28 Sep 2010 02:15:52 pm masawudu bature wrote: > I'm having a hard time finding the count of divisors that are even. > Help anybody? > > Here's my code. > > The output is suppose to count the number of even divisors the range > has.
I don't understand the question. What do you mean by "divisors the range has"? Perhaps you should show an example, and give the answer you expect. This function is troublesome: > def evenCount(b) : > for n in range(x, y+1) : > count = 0 > if n % 2 == 0 : > count += n/3 > count % n == 1 > return n What's b? It is never used. Every time through the loop, you start the count at zero again. This function will always return y, the stopping value. -- Steven D'Aprano _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor