String Methods
isspace()
Check whether every character is whitespace.
str.isspace()
Check whether every character is whitespace.
Result
Returns
True when the string is non-empty and all characters are whitespace; otherwise False.
Run it
Try it
Run it and change it
text = " \t\n" print(text.isspace())
Output
Press Run to see what it prints.