Writes and runs Python to compute or verify an answer, returning the code, its output, and a final answer.