How to check if a string is empty in python?

attn.steven.kuo at gmail.com attn.steven.kuo at gmail.com
Wed May 2 16:51:17 EDT 2007


On May 2, 1:35 pm, noagbodjivic... at gmail.com wrote:
> How to check if a string is empty in python?
> if(s == "") ??



Empty strings and containers are false; so
one can write

if (not s):
    print "something..."


--
Hope this helps,
Steven




More information about the Python-list mailing list