How to check if a string is empty in python?

mensanator at aol.com mensanator at aol.com
Wed May 2 16:52:35 EDT 2007


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?

>
> -Basilisk96





More information about the Python-list mailing list