Check the following in settings so that the last run result can be cleared automatically when running the file:
You can also add the following codes to your settings.json
:
"code-runner.clearPreviousOutput": true,
"code-runner.runInTerminal": true