how to check if a string contains spaces in python

Solutions on MaxInterview for how to check if a string contains spaces in python by the best coders in the world

showing results for - "how to check if a string contains spaces in python"
Clara
21 Sep 2016
1#isspace() is a built-in method used for string handling
2string = "My name is"
3print(string.isspace())
4#It will print True
5
6string = "Hello"
7print(string.isspace())
8#It will print True