checking if a list is empty

James Mills prologic at shortcircuit.net.au
Fri May 6 07:34:27 EDT 2011


On Fri, May 6, 2011 at 4:36 PM, Jabba Laci <jabba.laci at gmail.com> wrote:
> If I want to check if a list is empty, which is the more pythonic way?

[...]

> (2) if not li:

This is fine.

cheers
James

-- 
-- James Mills
--
-- "Problems are solved by method"



More information about the Python-list mailing list