Empty strings are "falsy" (python 2 or python 3 reference), which means they are considered false in a Boolean context, so you can just do this:

if not myString:

This is the preferred way if you do not need to differentiate between an empty string and some other falsy value. To explicitly check for an empty string use the following:

if myString == "":

See the documentation on Truth Value Testing for other values that are false in Boolean contexts.

Answer from Andrew Clark on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › initialize-empty-string-in-python
Initialize empty string in Python - GeeksforGeeks
July 23, 2025 - The simplest way to define an empty string is by using two quotation marks with nothing in between. These can be single (') or double (") quotes. Both are valid. ... You can also use Python’s built-in str() function to create an empty string.
Discussions

.Empty string comprehension?
Hello everyone , I wrote this code that I understand except one detail in it , here’s the code : person_infos(first_name, last_name, age=''): person = {'first': first_name, 'last': last_name} if age: per… More on discuss.python.org
🌐 discuss.python.org
4
1
March 14, 2020
What’s the difference between None and an Empty String (“ “)?
one of them is a string, with which you can do all the string stuff. the other is nothing More on reddit.com
🌐 r/learnpython
7
3
June 21, 2020
Is there a better way to make an empty string?
player_inputs = list(), or more pythonic, player_inputs = [] More on reddit.com
🌐 r/learnpython
15
2
January 22, 2020
Meaning of empty string "" in this example
From the documentation : The separator between elements is the string providing this method. Maybe not so clear, but it means the iterable in str.join(iterable) will be joined with str as separtor. Some examples: >>> l = ['a', 'b', 'c'] >>> ''.join(l) 'abc' >>> ','.join(l) 'a,b,c' >>> '__'.join(l) 'a__b__c' >>> '! !'.join(l) 'a! !b! !c' More on reddit.com
🌐 r/learnpython
5
1
November 6, 2022
🌐
Jeremy Morgan
jeremymorgan.com › python › how-to-create-an-empty-string-in-python
How to Create an Empty String in Python - Jeremy Morgan's
December 10, 2023 - This approach creates an empty string by enclosing nothing between two sets of double quotes. This is the most common method for creating an empty string in Python.
🌐
Python.org
discuss.python.org › python help
.Empty string comprehension? - Python Help - Discussions on Python.org
March 14, 2020 - Hello everyone , I wrote this code ... return person a = person_infos('fna', 'lna', age=34) print(a) The variable age in the function definition is an empty string , but we when set age as a number ( age = 4 ) no error happens , ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-program-to-check-if-string-is-empty-or-not
Check if String is Empty or Not - Python - GeeksforGeeks
July 11, 2025 - If len(s) == 0 then the string is empty. In Python, empty strings are treated as "Falsy".
🌐
Sentry
sentry.io › sentry answers › python › check if a string is empty in python
Check if a string is empty in Python | Sentry
May 15, 2023 - if my_string.strip() == "": print("my_string is an empty string!") else: print("my_string is not an empty string!") ... Tasty treats for web developers brought to you by Sentry. Get tips and tricks from Wes Bos and Scott Tolinski. SEE EPISODES ... David Y. — July 15, 2023 · Difference between `@staticmethod` and `@classmethod` function decorators in Python
Find elsewhere
🌐
TutorialKart
tutorialkart.com › python › python-create-an-empty-string
How to create an Empty String in Python?
April 3, 2023 - To create empty string using str(), call the function, and pass no arguments to the function, and it returns an empty string.
🌐
Enterprise DNA
blog.enterprisedna.co › python-empty-string
Python Empty String: Explained With Examples – Master Data Skills + AI
Methods like the len() function or the eq operator can identify when a string is empty or not empty. As a Python developer, you should recognize the simple and more complex methods to assign and identify empty strings.
🌐
LabEx
labex.io › tutorials › python-how-to-handle-empty-string-scenarios-418005
How to handle empty string scenarios | LabEx
This tutorial explores comprehensive ... contexts. In Python, an empty string is a string with zero characters, represented by two single or double quotes without any content: '' or ""....
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › check if string is empty or not in python
Check if String is Empty or Not in Python - Spark By {Examples}
May 21, 2024 - How to check if the Python String is empty or not? In python, there are several ways to check if the string is empty or not. Empty strings are considered
🌐
30 Seconds of Code
30secondsofcode.org › home › python › string is empty
How can I check if a string is empty in Python? - 30 seconds of code
August 5, 2022 - empty_string = '' non_empty_string = 'Hello' non_string = 0 empty_string == '' # True non_empty_string == '' # False non_string == '' # False ... Learn how to format and manipulate strings in Python 3.6 with this article collection.
🌐
Stanford
web.stanford.edu › class › archive › cs › cs106a › cs106a.1204 › handouts › py-string.html
Python Strings
It is valid to have a string of zero characters, written just as '', called the "empty string". The length of the empty string is 0. The len() function in Python is omnipresent - it's used to retrieve the length of every data type, with string just a first example.
🌐
Squash
squash.io › how-to-check-for-an-empty-string-in-python
How to Check for an Empty String in Python - Squash Labs
November 2, 2023 - We use an if-else statement with the not operator to check if string is empty. If it is, we print "The string is empty"; otherwise, we print "The string is not empty". Related Article: Python Command Line Arguments: How to Use Them
🌐
PythonHow
pythonhow.com › how › check-if-a-string-is-empty
Here is how to check if a string is empty in Python
my_string = "" if not bool(my_string): print("String is empty.") ... Solve Python exercises and get instant AI feedback on your solutions.
🌐
Stack Abuse
stackabuse.com › how-to-check-if-a-string-is-empty-or-none-in-python
How to Check if a String is Empty or None in Python
June 5, 2023 - In both of these methods, the if statement will print "String is empty" if the string s is empty. The not operator in the second example negates the "truthiness" or "falsiness" of the string, making the code slightly more concise. This is a common Pythonic way to check for empty strings.
🌐
Tutor Python
tutorpython.com › check-if-string-is-empty-in-python
How to Handle or Check if String is empty in Python
December 25, 2023 - One of the most straightforward methods to check if string is empty in python is by directly comparing it with an empty string using == operator.
🌐
LabEx
labex.io › tutorials › python-how-to-manage-empty-string-inputs-438180
How to manage empty string inputs | LabEx
This tutorial explores essential ... and prevent potential errors in their code. In Python, an empty string is a string with zero characters....
🌐
datagy
datagy.io › home › python posts › python strings › how to check if a string is empty in python
How to Check if a String is Empty in Python • datagy
December 16, 2022 - To get semantics out of the way, ... Pythonic, way of checking if a string is empty in Python is to simply use an if-else block with the not keyword....