Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to check a string is empty in python

my_string = ""

if my_string == "":
  print(True)
else:
  print(False)

# Remember if you have even a white space in the string, the output will be - False.
 
PREVIOUS NEXT
Tagged: #check #string #empty #python
ADD COMMENT
Topic
Name
5+4 =