Необходимо удалить знаки препинания из списка и затем сохранить его в том же списке
Код:
sentences = ["Hi! How are you doing?","Hope everything is fine.","Have an amazing day!"]
type(list1)
sentences = sentences.translate(str.maketrans('', '', string.punctuation))
Ошибка:
AttributeError Traceback (most recent call last)
<ipython-input-4-7b3b0cbf9c58> in <module>()
1 sentences = ["Hi! How are you doing?","Hope everything is fine.","Have an amazing day!"]
2 type(list1)
----> 3 sentences = sentences.translate(str.maketrans('', '', string.punctuation))
AttributeError: 'list' object has no attribute 'translate'