string 자료형 문장부호 없애는 방법 string.puctuation
string 자료형에서 ' , . ! ? 등 문장을 읽기 쉽게 나타낼 때 import string data ='Let`s go to lunch!' result = data.translate(str.maketrans('','',string.punctuation)) print(result) # Lets go to lunch # 다른방법 punct = string.punctuation for c in punct: data = data.replace(c, "") print(data) # Lets go to lunch 출처: https://www.delftstack.com/ko/howto/python/how-to-strip-punctuation-from-a-string-in-python/#%25ED%258C%25..
2021.07.09