我想有效地从我的字符串中删除所有符号。
x = hello!!
r = dict.fromkeys(map(ord, '\n ' + string.punctuation))
x.translate(r)
我希望这会删除所有符号,而不仅仅是句号(。)
智慧大石
相关分类