Page 1 of 1

PYTHON QUESTION! Punctuations are typically individual characters such as "!", "?", "." etc. that are also often not use

Posted: Wed Apr 27, 2022 3:40 pm
by answerhappygod
PYTHON QUESTION!
Punctuations are typically individual characters such as "!",
"?", "." etc. that are also often not useful in text analysis.
Write a function remove_punc(sentence, punctuation) which
takes input parameters sentence (type string)
and punctuation (type string), and returns a
string that strips
all trailing punctuations in sentence.
Here, punctuations are NOT separated by a space, but they
all should be removed. Also, you should not assume that punctuation
would only contain the usual punctuations.
For example: