Checking if elements are empty
Lawrence D'Oliveiro
ldo at geek-central.gen.new_zealand
Thu Sep 6 22:52:33 EDT 2007
In message <mailman.93.1189003016.2658.python-list at python.org>, Chris Mellon
wrote:
> On 9/5/07, Steve Holden <steve at holdenweb.com> wrote:
>> Doran, Harold wrote:
>
>> >
>> > Is there a way to check if the first element of y is null?
>> >
>>
>> len(y[0]) == 0
>>
>> would be the obvious way, assuming "null" means "the null string".
>>
>
> Better spelled as
>
> if y[0]:
Not a good idea.
More information about the Python-list
mailing list