textutils.remove_punctuation

textutils.remove_punctuation(text)

Remove all punctuation from the given text.

Parameters

Name Type Description Default
text str The text from which to remove punctuation. required

Returns

Name Type Description
str The text with all punctuation removed.

Raises

Name Type Description
TypeError If the input text is not a string.

Examples

>>> remove_punctuation('Hello, World!')
'Hello World'
>>> remove_punctuation('What?! No way...')
'What No way'
>>> remove_punctuation('')
''
>>> remove_punctuation('Numbers 123 are fine!')
'Numbers 123 are fine'
>>> remove_punctuation('Emojis 😀 stay too!')
'Emojis 😀 stay too'