Python去除文本全部標點符號

去除標點符號方式多種多樣,這裏介紹兩種本身經常使用的。python 一、python自帶punctuation包,能夠消除全部中文標點符號。string import re,string from zhon.hanzi import punctuation text = " Hello, world! 這,是:我;第!一個程序\?()()<>《》 " print(re.sub(r"[%s]+" %
相關文章
相關標籤/搜索