python string remove specific substring code example
Example 1: remove substring python
>>> papa = 'papa is a good man'
>>> papa.replace('papa', '')
' is a good man'
Example 2: remove specific word from string using python
#you can use replace function to remove specific word.
>>> message = 'you can use replace function'
>>> message.replace('function', '')
>>>'you can use replace '