Check whether the string is empty or not in Python

We can use boolean logic to check whether the string is empty or not.

if not string:
        print "string empty"
else:
        print string

That's all......

 

Leave a Reply