Skip to content
Advertisement

vscode python no output

print("hello")

Whatever I write in the python file, it only gives the current file path. How could I fix it?

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
Gangs-MacBook-Pro:yashirq gangzhao$ /usr/bin/python3 /Users/gangzhao/yashirq/Practice/Python/Grokking_Algorithms/Binary_Search.py

enter image description here

Advertisement

Answer

I just ran this program in VS Code and it worked fine.

Just right click and select ‘Run Python file in terminal’ options. It should work!

Run Python file in terminal

Sample Code

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement