Create a hello world program in python using Visual Studio Code

By: On:

In this tutorial, we will discuss how to create a hello world program in python, and also, we will see how to download and install visual studio code in windows 10.

What is Visual Studio Code?

Microsoft provides a Visual Studio Code the free and open-source code editor. It is fast and straightforward. Visual Studio Code supports all three operating systems like Windows, Linux, and macOS.


It has a lot of built-in features like GitHub, debugging and embedded Git control, syntax highlighting, snippets, and intelligent code completion. Also, you can add extensions to create a Python development environment as per your need.

VS Code is lightweight and it has many powerful features. This is the reason why it becoming popular among Python developers. Visual studio code is a code editor that you can use for python development. This is not only mean for python, It supports other languages also.

If you are new to python, you can check below tutorials:

Download and Install Visual Studio Code in Windows 10

Let’s see how to download and install free visual studio code (VS Code).


Step-1

First download visual studio code. Based on the operating system, you can download VS Code.

visual studio code download and installation
visual studio code

Step-2

  • After downloading, Open the VS Code and then accept the agreement and click on Next.
  • Once you will click on Next, a default location will appear. If you don’t want to change the default location then click on Next.
visual studio code download
download and install vs code

Step-3

Now click on “create a desktop icon” so that it can be accessed from desktop and then click on Next.

How to download visual studio code
visual studio code

Step-4

After that, click on the Install button. It will start installing the VS Code.

visual studio code download 64-bit windows 10

Step-5

Finally, installation completes, and by default the Launch Visual Studio Code will appear with check mark. Click on the Finish button, and the visual studio code will get open.

download visual studio code

Step-6

Now you can see Visual Studio Code has been started on windows 10.

How to download visual studio code

Install Python Extension for Visual Studio Code

To install the extension, open up the extension, menu which is present on the left side, and write on the search space “Python”.

Then select the first one that pops up, You can click Install for the respective extension.

install python extension vs code

Create hello world program in python using Visual Studio Code

Now, we will see how to create hello world program in python in vs code.

Open visual studio code. Then File -> New File.

Then in the file write the below code:

msg = "Hello World"
print(msg)

Then Save the file Ctrl+S and then give a file name with .py extension and save type as Python.

python hello world program

The file will looks like below:

python hello world program using vs code

To Run the code, Right-click anywhere in the editor window and select Run Python File in Terminal.

create hello world program in python

Output:

The output you can see in the Terminal like below:

how to create hello world program in python

You can also, Run the code manually using the command line by simply writing python and Path of the file in the terminal.

create a basic hello world program in python

You can see below, I have copied the Path of the File after writing python.

python E:\project-python\HelloWorld.py
create hello world program in python
create hello world program in python

Now, If you enter then you will see the Output.

hello world python program

So, In this Python tutorial, we learned how to create hello world program in python using visual studio code. and how to download and install Visual Studio Code in windows 10, and also we have seen how to install Python Extensions in vs code.

Leave a Comment