Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode Python - print statement not printing to output

I am new to VSCode. I have set it up on Windows. When I run it using Code Runner,I see Running and Done messages but the print statements are not working.

print("Hello World!")
print ("This is VS Code")
a=1
while a <10:
    print a
    a = a+ 1

Here is the output:

[Running] python -u "c:\Users\user\PythonWorkArea\VSCode\HelloWorld\app.py"
[![\[Done\] exited with code=0 in 0.293 seconds][1]][1]

The print statement is not working.

enter image description here

What am I doing wrong?

like image 339
Shankze Avatar asked Jul 08 '26 07:07

Shankze


1 Answers

You should select the appropriate Python Environment that you are using, do Control+Shift+P -> Python: Select Interpreter.

I had the same issue and had to change the default env to get it working.

like image 161
Abhijit Pai Avatar answered Jul 13 '26 20:07

Abhijit Pai