Credit Karma surfaces may display user-written text containing multiple sentences. Implement a function that capitalizes the first word of each sentence while preserving every other character, including punctuation and whitespace.
A sentence begins at the start of the string or immediately after ., !, or ? when that punctuation is followed by whitespace or the end of the string. Ignore leading whitespace before the first word. Inputs contain ASCII letters, spaces, tabs, and sentence punctuation. You may assume each sentence begins with an ASCII letter after optional whitespace.
Given a string text, return a new string with the first letter of every sentence converted to uppercase. Do not change the capitalization of any other letters, and do not remove or add characters.
., !, ? punctuation appeardef capitalize_sentences(text):