Your question is Capitalize Every String Letter. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
CentralSquare Public Safety Suite may need incident text normalized before it is displayed or logged. Implement a function that converts every letter in a string to uppercase while leaving spaces, digits, punctuation, and other non-letter characters unchanged.
Given a Python string text, return a new string containing the uppercase version of every letter in text. The input may contain lowercase letters, uppercase letters, whitespace, digits, punctuation, and Unicode characters. Do not modify the original string, and do not remove or reorder characters.
Example 1:
Input: text = "Unit 12: respond to Main St."
Output: "UNIT 12: RESPOND TO MAIN ST."
Letters become uppercase, while the space, digits, colon, and period remain unchanged.
Example 2:
Input: text = "Report #a-17 complete!"
Output: "REPORT #A-17 COMPLETE!"
Only alphabetic characters change; #, -, and 17 are preserved.
0 <= len(text) <= 10^5text is a valid Python string.def capitalize_text(text):