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
1 week 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 ...
๐ŸŒ
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.
๐ŸŒ
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 ...
๐ŸŒ
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: [...