If not having a value has a meaning in your program (e.g. an optional value), you should use None. That's its purpose anyway.

If the value must be provided by the caller of __init__, I would recommend not to initialize it.

If "" makes sense as a default value, use it.

In Python the type is deduced from the usage. Hence, you can change the type by just assigning a value of another type.

>>> x = None
>>> print type(x)
<type 'NoneType'>
>>> x = "text"
>>> print type(x)
<type 'str'>
>>> x = 42
>>> print type(x)
<type 'int'>
Answer from wierob 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.
🌐
Jeremy Morgan
jeremymorgan.com › python › how-to-create-an-empty-string-in-python
How to Create an Empty String in Python
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.
🌐
Reddit
reddit.com › r/learnpython › is there a better way to make an empty string?
r/learnpython on Reddit: Is there a better way to make an empty string?
January 22, 2020 -

Total curiosity, but is there a way I can do this better:

player_inputs = ["", ""]

I want to have a list of 2 strings, but the strings will be inputed later. I thought I could do this:

player_inputs = [str, str]

but that doesn't work, not sure why.

🌐
Python Examples
pythonexamples.org › python-create-empty-string
Creating an Empty String in Python: 3 Different Methods
In the following program, we create empty string using str() builtin function. Pass no value as argument to str() function. The function returns an empty string. ... In this tutorial of Python Examples, we learned how to create an empty string in different ways, with the help of well detailed examples.
🌐
Codecademy
codecademy.com › forum_questions › 5194c9c37a57d7acad002a26
Possible to declare an empty string? | Codecademy
Hi there, just curious about being able to declare a string variable that has no value assigned to it but is ready to be used. Is it possible? And how would Python know what sort of variable it is since, from my experience, the type of variable is decided when the variable is defined? Or would that happen when you do assign a value to the variable? For eg. would my_name = None be an empty ...
🌐
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.
Find elsewhere
🌐
Appdividend
appdividend.com › create-and-check-if-a-string-is-empty-in-python
How to Create and Check an Empty String in Python
August 30, 2025 - double_empty_string = "" print(double_empty_string) # Output: "" print(type(double_empty_string)) # Output: <class 'str'> single_empty_string = '' print(single_empty_string) # Output: '' print(type(single_empty_string)) # Output: <class 'str'> If you run the above program on the Python terminal, it will display an empty string by printing nothing.
🌐
YouTube
youtube.com › watch
Python An Empty String - YouTube
Shows how to create an empty string and discusses the nature of such a string.
Published   September 23, 2014
🌐
Python Forum
python-forum.io › thread-17542.html
Use range to add char. to empty string
This seems simple enough, but I can't seem to get my head around it. The problem: Create an empty string and assign it to the variable lett. Then using range, write code such that when your code is run, lett has 7 b’s ('bbbbbbb'). My attempt: let...
🌐
Enterprise DNA
blog.enterprisedna.co › python-empty-string
Python Empty String: Explained With Examples – Master Data Skills + AI
An empty string is a string that contains no characters. Empty strings can be created in Python using the str() function or assigning a variable with single or double empty quotes.
🌐
Rosetta Code
rosettacode.org › wiki › Empty_string
Empty string - Rosetta Code
3 weeks ago - OIC KTHXBYE · -- create an empty string 3 different ways str = "" str = '' str = [[]] -- test for empty string if str == "" then print "The string is empty" end -- test for nonempty string if str ~= "" then print "The string is not empty" end ...
🌐
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 ... code : person_infos(first_name, last_name, age=''): person = {'first': first_name, 'last': last_name} if age: person['age'] = age return person a = person_infos('fna', 'lna', age=34) print(a) The variable ...
🌐
Finxter
blog.finxter.com › python-create-list-of-n-empty-strings
Python – Create List of N Empty Strings – Be on the Right Side of Change
You can create a list of n empty strings by using list comprehension statement ['' for _ in range(n)] that uses the range() function to repeat the creation and addition of an empty string n times.
🌐
Reddit
reddit.com › r/learnpython › meaning of empty string "" in this example
r/learnpython on Reddit: Meaning of empty string "" in this example
November 6, 2022 -
import random

def shuffle(string):
    templist = list(string)
    random.shuffle(templist)
    return "".join(templist)

usablelower = chr(random.randint(97, 122))
usableupper = chr(random.randint(65, 90))
usablenum = chr(random.randint(48, 57))

rst = random.choice(usableupper)
rst1 = random.choice(usablelower)
rst2 = random.choice(usablenum)
pw = rst1 + rst + rst2 + rst + rst2 + rst1
pw = shuffle(pw)
print(pw)

Hello, I was trying to code a random password generator yet I could not understand the "return "".join(templist)" part. What is the use of empty string here, what does it do and why this code require it?

🌐
Quora
quora.com › Does-Python-have-something-like-an-empty-string-variable-where-you-can-do-if-myString-string-empty-Regardless-whats-the-most-elegant-way-to-check-for-empty-string-values
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? - Quora
Answer (1 of 3): I would test noneness before stripping. Also, I would use the fact that empty strings are False (or Falsy). This approach is similar to Apache's StringUtils.isBlank or Guava's Strings.isNullOrEmpty This is what I would use to test if a string is either None OR Empty OR Blank: [...
Top answer
1 of 1
4
Hi Tabish Kazi, Without looking at the video, I can tell you that in the specific example given, the second code example would lead to the same result as the first code example. The real difference lies in the operator used. In the first example you use the plus-equal operator which reads the current value of the variable and adds the value to the right of the operator to it, then stores the new value to the variable. In the second example, the value to the right of the assignment operator is stored in the variable with no preference to what is already stored in the variable. The thing is though, in order for the plus-equal operator to work, the value of the variable can’t be null or undefined. So say you were looping through a series of properties and you wanted to dynamically create an HTML list item for each valid property without knowing how many list items would need to be created in advance. Well you know you’re going to wrap all this HTML within a string (and later set the innerHtml of some element to be equal to this string). And so you want to continually build upon this HTML string for however long the for loop runs. And so you decide to use the plus-equal operator to add to this string, but if the variable you’re adding to isn’t already a string, then the JS interpreter wouldn’t be able to add the first list item to it (a string of html defined declaratively). The program/code would crash. This is because the interpreter wouldn’t know how to add an undefined value and a string together (just as the interpreter wouldn’t know how to add something like a string and an integer together). So you initialize the variable as an empty string so that the interpreter knows that the variable is indeed a string, and as such, can be concatenated with other strings. I’m thinking that maybe I’ve over explained a bit, but I hope that makes sense. Let me know if it doesn’t.