Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

Most elegant way to check if the string is empty in Python?

Asked by Jacob Rutherford Mar 9, 2021 1.3K views 1 answer
Share

About this question

Does Python have something like an empty string variable where you can do:

if myString == string.empty:

Regardless, what's the most elegant way to check for empty string values? I find hard coding "" every time for checking an empty string not as good. 

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.