Python 3.7 isspace tutorial can be found at https://www.mastercode.online/courses...
Be sure to like, share and comment to show your support for our tutorials.
=======================================
Channel - https://goo.gl/pnKLqE
Playlist For This Tutorial - https://goo.gl/EyZFti
Latest Video - https://goo.gl/atWRkF
Facebook - / mastercodeonline
Twitter - https://twitter.com/mastercodeonlin?l...
Website - http://mastercode.online
======================================
Python Isspace String Method
In this Python tutorial we take a look at the Python isspace string method. The isspace string method will check a string object to confirm if the string object only contains white space if so then Python will return True if the object contains any other character other than a space then Python will return False.
Python Isspace String Method Syntax
'String Object'.isspace()
'String Object' - This is our string object that will be evaluated by the isspace string method.
.isspace() - The isspace string method will evaluate our string object and return a True if the object only contains spaces or False if our object contains anything other than a space.
Examples Of The Python Isspace String Method
#Example 1
''.isspace()
False
#Example 2
' '.isspace()
True
#Example 3
' a'.isspace()
False
Examples Explained
Example 1:
''.isspace() - We create a empty string object and call isspace on our string method. Empty string contains no characters or spaces.
False - We are returned False because the string does not contain any spaces.
Example 2:
' '.isspace() - We create a string object that contains a space then we call the isspace string method on the string.
True - We are returned True since the string object contains a space.
Example 3:
' a'.isspace() - We create a string object that contains a space and the letter 'a'. Then we call our string isspace string method on our string object.
False - We are returned a False boolean since our string contains a letter. The isspace string method must only contain only spaces for a True boolean return.
Conclusion
In this Python tutorial, we took a look at the isspace string method in Python which returns True if the string object only contains spaces. If the string object contains anything other than a space then Python will return False. If you have any questions about isspace string method leave a comment below.
En esta página del sitio puede ver el video en línea Python Isspace String Method de Duración hora minuto segunda en buena calidad , que subió el usuario Code master 29 septiembre 2015, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 3,854 veces y le gustó 45 a los espectadores. Disfruta viendo!