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:
PYTHON QUESTION! Punctuations are typically individual characters such as "!", "?", "." etc. that are also often not use
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
PYTHON QUESTION! Punctuations are typically individual characters such as "!", "?", "." etc. that are also often not use
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!