python check if string or not