Checking if elements are empty

Wildemar Wildenburger lasses_weil at klapptsowieso.net
Tue Sep 11 06:06:17 EDT 2007


Steve Holden wrote:
> Neil Cerutti wrote:
>  >>> y = ""
>  >>> if y[0] == "":
> ...   print "True"
> ... else:
> ...   print "False"
> ...
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> IndexError: string index out of range
>  >>>
> 
Uhm, weren't we talking about a list of strings?

/W



More information about the Python-list mailing list