On Mar 26, 1:38 am, srinivasan srinivas <sri_anna...@yahoo.co.in> wrote:
Depends on what you mean by "best"; like graduation day at kindergarten, everyone gets a prize: > For ex: to check list 'A' is empty or not.. > if A == []: most obviously correct > if A.count == 0: best use of imagination > if len(A) == 0: best use of a built-in function > if not A: most Pythonic, most laconic, fastest -- http://mail.python.org/mailman/listinfo/python-list