SyntaxFix
Write A Post
Hire A Developer
Questions
I find this elegant as it makes sure it is a string and checks its length:
def empty(mystring): assert isinstance(mystring, str) if len(mystring) == 0: return True else: return False