def generate_fix(code): lines = code.split("\n") fixed_lines = [] for line in lines: if line.strip().startswith("print ") and not line.strip().startswith("print("): content = line.strip()[6:].strip() fixed_lines.append(f"print({content})") else: fixed_lines.append(line) return "\n".join(fixed_lines) # Optional test if __name__ == "__main__": buggy = "a = input()\nprint a" print(generate_fix(buggy)) #genrate the fixed version of code using an ML Model