testText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque nec mauris nec tellus mollis ullamcorper. Vestibulum sit amet arcu placerat, sagittis quam sed, rutrum sem. Morbi vulputate odio non lacus."
splitText = testText.split(" ")
print(splitText)
cleanedText = ''
for letter in testText:
if letter in list('.,:;?!'):
cleanedText.append(letter)
''.join(cleanedText)
I am trying to remove all punctuation in the paragraph above, but I am running into an "Attribute Error: 'str' object has no attribute 'append'".
What could potentially be going wrong and how should I go about resolving it?
Additionally, how would I then only print worlds equal to or longer than five characters and contain an 'i'?