How to check if a string is empty in python?

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Wed May 2 19:41:19 EDT 2007


mensanator at aol.com a écrit :
> On May 2, 3:49 pm, Basilisk96 <basilis... at gmail.com> wrote:
> 
>>A simple
>>
>>if s:
>>    print "not empty"
>>else:
>>    print "empty"
>>
>>will do.
> 
> 
> How do you know that s is a string?

Why do you want to know if it's a string ?




More information about the Python-list mailing list