On 2007-10-17, Debajit Adhikary <[EMAIL PROTECTED]> wrote: > # Start of Code > > def evenOdd(): > values = ["Even", "Odd"] > state = 0 > while True: > yield values[state] > state = (state + 1) % 2
I'd replace the last line with state ^= 1 to save a couple instructions, but I spend too much time working with micoroprocessors running on clocks measured in the KHz. There are probably other more Pythonic ways... -- Grant Edwards grante Yow! My EARS are GONE!! at visi.com -- http://mail.python.org/mailman/listinfo/python-list