What way is the best to check an empty list?

Discussion in 'Python' started by srinivasan srinivas, Mar 25, 2009.

  1. For ex: to check list 'A' is empty or not..
    if A == []:
    if A.count == 0:
    if len(A) == 0:
    if not A:


    Connect with friends all over the world. Get Yahoo! India Messenger at http://in.messenger..yahoo.com/?wm=n/
    srinivasan srinivas, Mar 25, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marcia Hon

    Check if a directory is empty and empty it

    Marcia Hon, Feb 8, 2004, in forum: C Programming
    Replies:
    8
    Views:
    564
    Dave Thompson
    Feb 14, 2004
  2. srinivasan srinivas

    What way is the best to check an empty list?

    srinivasan srinivas, Mar 25, 2009, in forum: Python
    Replies:
    6
    Views:
    539
    Steven D'Aprano
    Mar 26, 2009
  3. Steve Holden
    Replies:
    2
    Views:
    903
    Niklas Norrthon
    Mar 26, 2009
  4. laredotornado
    Replies:
    35
    Views:
    2,382
    Tom Anderson
    Mar 10, 2010
  5. mark4asp

    What is the best way to empty a list box?

    mark4asp, Nov 3, 2006, in forum: Javascript
    Replies:
    2
    Views:
    65
Loading...

Share This Page