This article focuses on the use of Python's Isspace () method of handling strings, which is the basic knowledge of Python's introduction, and needs friends to refer to the following
The Isspace () method checks whether the string contains spaces.
The following is the syntax for the Isspace () method:
Returns False if there are only whitespace characters in the string and at least one character this method returns True.
The following example shows the use of the Isspace () method.
|1 2 3 4 5 6 7||#!/usr/bin/python str = ""; Print Str.isspace (); str = "This is string Example....wow!!!"; Print Str.isspace ();|
When we run the above program, it produces the following results:
|1 2||True False|