Actually a simple implementation:
out = "".join(c for c in asking if c not in ('!','.',':'))
and keep adding any other punctuation marks.
A more efficient way would be
import string
stringIn = "string.with.punctuation!"
out = stringIn.translate(stringIn.maketrans("",""), string.punctuation)
Edit: Here are some more discussions of efficiency and other implementations:
Best way to block punctuation from a string in Python
source
share