I've try the coderunner extension setting but it's have an issues like this
Add this your settings.json
"debug.terminal.clearBeforeReusing": true
Then run your python file using VS Code Debugger, just hit F5 then it will clear the terminal everytime you run the code. Tell me if it work!
If you are using code-runner, first make sure you have installed the code-runner extension.
Select Run Code when using this extension for the first time:
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