Skip main navigation

New offer! Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. New subscribers only. T&Cs apply

Find out more

Hands-on with Visual Studio Code, your text editor

Learn algorithms, logic, and Python basics. Create simple programs, grasp computer science fundamentals, and see its impact across various fields.

In this course, you will learn to code using Microsoft Visual Studio Code. This is an application that you can use to write and edit Python programs. It also has an integrated environment to execute Python commands (the terminal/Python interpreter) so you can run your code and see the results.

First, you will need to install Python and Visual Studio Code on your computer. The steps vary depending on your specific operating system.

Prepare

If you face difficulties installing the above on your computer, please search online “How to install Python 3 on Windows”, “How to install Microsoft Visual Studio Code on macOS” for detailed tutorials.
Once you have installed both you will be able to open VS Code and start writing your first Python programs. 

The “Hello, world” program

When you learn a new programming language, it’s common practice to create a simple program in the language to test that everything works! It has become a convention that this simple program outputs the words “hello, world”, and is referred to as a “Hello, world” program.

Create a simple program

Follow the instructions below to create your first ‘Hello world’ Python program.
  1. Open Visual Studio Code
  2. Create a new file by clicking File → New File.
  3. Save the file by pressing CTRL + S (or CMD + S on a Mac).
  4. Name the file hello-world.py
  5. You can write your code in the Editor Pane (see below): 
Write the following line in the editor pane:
print('Hello, world!')

Run the code

  1. From the menu bar, click Terminal → New Terminal
  2. Run your program by typing python hello-world.py (and then hit the ENTER key) in the terminal pane.
  3. Observe the message hello, world! printed in the terminal!

Congratulations! You just created and executed your first simple Python program!

This article is from the free online

An Introduction to Programming Using Python

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now