On Thu, 10 Jun 2010 15:27:58 -0700, Martin wrote: > On Jun 10, 11:13 pm, Anthony Papillion <papill...@gmail.com> wrote: >> Thank you Emile and Thomas! I appreciate the help. MUCH clearer now. > > Also at a guess I think perhaps you wrote the syntax slightly wrong > (square brackets)...you might want to look up "list comprehension"
You guess wrong. Python also has generator expressions, which are written using round brackets instead of square. In short, the syntax: it = (expr for x in seq if cond) is equivalent to: def generator(): for x in seq: if cond: yield expr it = generator() except it doesn't create the generator function first. -- Steven -- http://mail.python.org/mailman/listinfo/python-list