在我看来,lambda表达式中有一个小错误。 尝试:
newString = [token for token in string.split() if not token.isdigit()]
当然 newString 现在是一个列表,但我希望这能回答您最初的问题。
newString