Spaces:
Running
Running
File size: 514 Bytes
7337ffe 22b22ed d57024f 22b22ed d57024f eef3533 d57024f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
def generate_fix(code):
lines = code.split('\n')
fixed_lines = []
for line in lines:
stripped = line.strip()
# Fix print statements missing parentheses
if stripped.startswith("print ") and "(" not in stripped:
expression = stripped[6:]
fixed_line = f"print({expression})"
fixed_lines.append(fixed_line)
else:
fixed_lines.append(line)
return "\n".join(fixed_lines)
#genrate the fixed version of code using an ML Model |