Answers for "python string if it has space"

0

python find if string contains space

def space(text):
    if ' ' in text:
        return True
    else: return False
Posted by: Guest on November-23-2021
-2

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 "python string if it has space"

Python Answers by Framework

Browse Popular Code Answers by Language