How to replace a word in a given sentence with a particular pattern if it's case insensitive in python?

Advertisements I am given the sentence My team is the BeST team at the tournament. as a test case to create create a function def case_insensitivity(sentence): return new_sentence which checks a given sentence for a case insensitive word and replaces the case insensitive word with XXX_. i.e. print(case_insensitivity(‘My team is the BeST team at the… Read More How to replace a word in a given sentence with a particular pattern if it's case insensitive in python?