Asked • 05/22/19

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

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.

1 Expert Answer

By:

John L. answered • 05/24/19

Tutor
4.9 (221)

Machine Learning Professor and More

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.