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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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