Python String isspace() MethodLast Updated : 30 Dec 2025 Python isspace() method is used to check space in the string. It returna true if there are only whitespace characters in the string. Otherwise it returns false. Space, newline, and tabs etc are known as whitespace characters and are defined in the Unicode character database as Other or Separator. Syntax of Python String isspace() MethodIt has the following syntax: ParametersNo parameter is required. ReturnIt returns either True or False. Different Examples for Python String isspace() MethodLet's see some examples of isspace() method to understand it's functionalities. Example 1Let us take an example to demonstrate the working of Python String isspace() Method. Output: True Example 2Let us take an example to demonstrate the working of Python String isspace() Method. Output: False Example 3isspace() method returns true for all whitespaces like:
Output: It contains space Not space It contains space Next TopicPython Strings |
We request you to subscribe our newsletter for upcoming updates.