这很简单。您可以检查字符串的第一个字符是否为. 见下面的例子sentences = [' this wont print', 'this will print', " this wont print either", " this will print"]for sentence in sentences: if sentence.startswith(' '): print(sentence)