Answers for "check if there is a space in string python"

0

python is space

# isspace() is method of the <str> returns True if the string has only empty spaces
print(" ".isspace())  # True
print("     ".isspace()) # True
print(" test".isspace())  # False
print("".isspace()) # False
Posted by: Guest on March-18-2021
-1

how to check if a string contains spaces in python

#isspace() is a built-in method used for string handling
string = "My name is"
print(string.isspace())
#It will print True

string = "Hello"
print(string.isspace())
#It will print True
Posted by: Guest on July-14-2021

Code answers related to "check if there is a space in string python"

Python Answers by Framework

Browse Popular Code Answers by Language