Easy Tutorial
❮ Ref Math Atanh Ref Math E ❯

Python3 isspace() Method

Python3 Strings


Description

The Python isspace() method checks if the string consists only of whitespace characters.

Syntax

The syntax for the isspace() method is:

str.isspace()

Parameters

Return Value

Returns True if the string contains only spaces, otherwise returns False.

Example

The following example demonstrates the isspace() method:

#!/usr/bin/python3

str = "       " 
print (str.isspace())

str = "tutorialpro example....wow!!!"
print (str.isspace())

The output of the above example is:

True
False

Python3 Strings

❮ Ref Math Atanh Ref Math E ❯