Simple - looking for a way to do an element exists check..

TeroV teroV at nowhere.invalid
Sat Feb 23 10:00:39 EST 2008


Boris Ozegovic wrote:
> Paul Rubin wrote:
> 
>>      if any(x[0]==element[0] for x in a): 
> 
> How come this list comprehension isn't in [] brackets?

It isn't list comprehension, it is generator expression 
http://en.wikipedia.org/wiki/Python_syntax_and_semantics#Generator_expressions

--
Tero



More information about the Python-list mailing list