On Wed, Mar 25, 2009 at 3:38 PM, srinivasan srinivas
<sri_anna...@yahoo.co.in> wrote:
>
> For ex: to check list 'A' is empty or not..
> if A == []:
> if A.count == 0:
> if len(A) == 0:
> if not A:

I would go for the last one, because it has the highest likelihood of
doing what is intended when fed with something that is 'list-like'
rather than a list. The second one is incorrect, by the way. A.count
is something completely different.

-- 
André Engels, andreeng...@gmail.com
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to