How to check if a string is empty in python?

Jaswant mailme.gurpreet at gmail.com
Fri May 4 06:02:37 EDT 2007


This is  a simple way to do it i think


s=hello

>>> if(len(s)==0):
...     print "Empty"
... else:
...     print s
...
hello




More information about the Python-list mailing list