Python Hello World with VS Code
( 34 Articles)
In this short article, you will learn how to write your first lines of Python code and run them with the built-in terminal of the VS Code.
Prerequisites: Make sure Python and VS Code already installed on your computer
Python Hello World Example
1. Create a new folder and open it with VS Code.
2. Create a new file named index.py inside the folder you’ve recently created. Add the following code to it:
3. Press “Ctrl” + “`” or select “View” > “Terminal” to open the built-in terminal of the VS Code (there is no difference between Windows and macOS). After that, enter the command below then press “Enter”:
If you’re using Python3, use this command instead:
4. You’ll see something similar to this:
That’s it, my friend :). This tutorial may be basic and boring for you, but from here, you’re pretty good to go.