string.punctuation

返回字符串常量:标点符号所组成的ASCII 字符串'!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~'

定义

string.punctuation

标点符号所组成的ASCII 字符串'!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~'

示例

import string

r = string.punctuation
print(r)

执行结果为 :

!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~