Write a python function to remove a given word from a list and strip it at the same time.

amannarayanm · September 23, 2021 · Python
def remove_Split(string,word):
    string =string.replace(word,"")
    print(string.strip())


sentence = "        Happy New Year buddy       "


remove_Split(sentence,"buddy")

Comments

Please sign up or log in to contribute to the discussion.