What is the syntax to see if a string only contains spaces?

<string name>.isspace()
#examples
str = 'hello world'
str2 = "   3     "
str3 = '      '

print(str.isspace())
print(str2.isspace())
print(str3.isspace())

#output
False
False
True
Advertisements