Python3 isspace() Method
Description
The Python isspace() method checks whether a string consists only of whitespace characters.
Syntax
Syntax of the isspace() method:
str.isspace()
Parameters
- none.
Return Value
Returns True if the string contains only spaces, otherwise False.
Example
The following example demonstrates the isspace() method:
Example
#!/usr/bin/python3
str
=
"
"
(
str
.
isspace
(
)
)
str
=
"
Runoob example....wow!!!
"
(
str
.
isspace
(
)
)
The output of the above example is:
True
False
Python3 Strings