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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
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

Post 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:
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply