how to check if string is whitespace in python