Skip to content
String Methods

isspace()

Check whether every character is whitespace.

str.isspace()

Check whether every character is whitespace.

Returns

True when the string is non-empty and all characters are whitespace; otherwise False.

Try it

Run it and change it
text = " \t\n"
print(text.isspace())

Related entries