Not able to setup variable value in the output console of VS Code

37 Views Asked by At

I am coding in Python and recently I have been facing this issue in which I am not able to set the variable value in the output console of VS Code. In the output console, it will show that the code is running but if I try to type to put in the values of the variable, the console won't work. I am not able to type the values.

I tried uninstalling and re-installing VS Code, but it didn't work. I am still facing the same issue. I tried removing unnecessary extensions also.

1

There are 1 best solutions below

0
Fifteen12 On

You might need to post your code so we can see the full issue. Despite that, I'll say that you can't change variables in a script during runtime through the console unless you set up a specific call for them, such as using x = input(x).

If you're wanting to test values of variables during execution you can use the Python debugger included in the basic Python extension in VS Code. Just set a breakpoint (toggle the red dot to the left of the line you want to pause at), run the program, then when the execution pauses go to the Debug Console tab in the console. This allows for dynamic updating of program variables using normal Python expression.