Given the expression “a b c d%f-g”, output “aBCDFG”. Explain how you would implement that transformation.
Keep only ASCII alphabetic characters, preserve the first retained character exactly, and convert every later retained character to uppercase. Return an empty string when the input contains no letters.
Function signature: def transform_expression(expression): The input is a string, and the output is the transformed string.
def transform_expression(expression):