Python Hello World with VS Code

June 19, 2020 Goodman Loading... Post a comment

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:

print("Hello World!")

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”:

 python index.py

If you’re using Python3, use this command instead:

 python3 index.py

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.

guest
0 Comments
Inline Feedbacks
View all comments

Related Articles

0
Would love your thoughts, please comment.x
()
x