On May 3, 2:03 pm, John Salerno <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On May 2, 3:49 pm, Basilisk96 <[EMAIL PROTECTED]> wrote: > >> A simple > > >> if s: > >> print "not empty" > >> else: > >> print "empty" > > >> will do. > > > How do you know that s is a string? > > Seems like a fair assumption given the OP's question and example.
A fair assumption for languages other than Python. Just because s was a string at some point in the past doesn't mean it's a string now. -- http://mail.python.org/mailman/listinfo/python-list