Start Coding Python with VS Code

A cartoon-style illustration shows a person’s hands typing on a laptop running Visual Studio Code in dark mode. The screen displays a Python file with the code print("Hello, world!"), alongside a large, colourful Python logo. The background is bright blue, creating a vibrant and engaging learning atmosphere.

When you start learning programming, the first thing you need is the right setup. That means two things:

  1. The language itself (Python), which is how you’ll give instructions to the computer.
  2. A workspace (Visual Studio Code, or VS Code), which is the place where you’ll write and run those instructions.

In this guide, you’ll get both installed and ready to go. Along the way, you’ll create your very first program — the classic “Hello, world!” — so you can see Python in action. By the end, you’ll have everything you need to start following tutorials, experimenting, and learning to code.

Step 1: Install Python

Python is the language we’ll be using.

  1. Go to python.org/downloads.
  2. Download the latest version of Python 3 for your computer (Windows, Mac, or Linux).
  3. Run the installer.
    • On Windows: Tick the box that says “Add Python to PATH” before clicking Install.

Check it worked:

  • Open the small black window called Command Prompt (on Windows) or Terminal (on Mac/Linux).
  • Type:
    • Windows: python --version
    • Mac/Linux: python3 --version
  • You should see something like Python 3.12.0. If you do, Python is ready.

Step 2: Install Visual Studio Code (VS Code)

Now that your computer understands Python, you need a place to write your code. That’s where VS Code comes in.

  1. Go to code.visualstudio.com.
  2. Download VS Code for your computer.
  3. Install it (just keep clicking Next if unsure).
  4. Open VS Code when it finishes.

Step 3: Add Python Support to VS Code

By default, VS Code doesn’t “speak” Python. We’ll add a little extension to fix that.

  1. In VS Code, look at the icons on the left-hand side. Click the one with four squares (Extensions).
  2. In the search bar at the top, type Python.
  3. Click on the Python extension by Microsoft and press Install.

Now VS Code knows how to run Python programs.

Step 4: Create Your First File

It’s a good habit to keep your projects in their own folder.

  1. On your computer, create a folder called learn-python.
  2. In VS Code, click File → Open Folder… and choose learn-python.
  3. Inside VS Code, click File → New File, and name it: hello.py

Step 5: Write Your First Program

In your new file (hello.py), type this line exactly:

This short instruction tells Python to display some text on the screen.

Step 6: Run Your Program

Now let’s see it work.

  1. In VS Code, look at the top right of the editor window. You’ll see a little play button (▶).
  2. Click it.
  3. At the bottom of the screen, you should see: Hello, world!

🎉 Congratulations — you’ve just written and run your very first Python program!

Step 7: Experiment

Try changing the message inside the quotes. For example:

Run it again and watch the new message appear.

What’s Next?

That’s all you need to begin. You now have Python installed, VS Code set up, and you know how to write and run a simple program.

From here, you can follow tutorials, play with code, and explore more features — but you’ve already taken the most important step: getting started!

Main Topic

Python Fundamentals

A colourful cartoon-style landscape illustration shows a person sitting at a computer terminal, looking overwhelmed by the amount of information on the screen. Papers and symbols float around them, representing different programming concepts. The word “Fundamentals” is clearly written above the scene, highlighting the focus on beginner Python basics.

Beginner’s guide to Python fundamentals: strings, numbers, booleans, syntax, and text manipulation explained simply and clearly.

Other Tutorials in this Topic

A playful cartoon-style landscape illustration shows a large elephant on the left and a small cat on the right. Between them, a bold greater than ( > ) symbol points toward the cat, representing a Python comparison operator in a fun way.

Python Operators

Beginner’s guide to Python operators: arithmetic, comparison, logical, assignment, membership, and identity explained with examples.

A colourful cartoon-style landscape illustration shows a smiling robot holding up two placards: one clearly labelled True and the other False. The background is bright and cheerful, symbolising the concept of Boolean values in Python programming.

Python Booleans

Learn Python Booleans: True or False values, comparisons, logic operators, and decision-making with simple examples.

ChatGPT said: A colourful cartoon-style landscape illustration shows two large labelled containers: one marked Integers filled with whole numbers like 7, 0, and -3, and another marked Floats filled with decimal numbers like 3.14, -0.5, and 2.0. A cheerful character is sorting the numbers into the correct containers, visually explaining the difference between integers and floating-point numbers in Python.

Python Numbers

Learn Python numbers: integers and floats, arithmetic operations, conversions, rounding, precision issues, and practical exercises for beginners…

A colourful cartoon-style landscape illustration shows the text “python ” written across the scene. Above the gap, a labelled box with the word “strings” is tilted, pouring its contents into the space, visually representing a variable being used to fill in a placeholder.

Python Strings – Part 4

Discover Python string formatting: use f-strings, .format(), and number formatting to neatly combine variables and text into…

A colourful cartoon-style landscape illustration shows the words “python strings” in lowercase being fed into a large whimsical machine. On the other side, the text emerges transformed into “PYTHON STRINGS” in uppercase letters, symbolising string methods like .upper(). The machine has gears and pipes, giving a fun and playful feel.

Python Strings – Part 3

Learn Python string methods: change case, remove spaces, replace text, split and join words, and check content…

A digital landscape illustration shows a beige fabric banner with the words “Python Strings” written across it. The material is ripped down the centre, with large visible stitches crudely sewing the two halves back together, symbolising fixing or escaping characters in strings. The background is simple and muted, drawing attention to the torn fabric.

Python Strings – Part 2

Explore Python strings further: escape characters, multi-line strings, and slicing to extract parts of text, with simple…

A colourful cartoon-style landscape illustration shows festive bunting strung across the top, with triangular flags spelling out “Python Strings” in bright, playful letters. The background is light and cheerful, giving a fun and welcoming atmosphere.

Python Strings – Part 1

Learn Python strings: text in quotes, printing, joining with +, counting length, and accessing characters by position…

A colourful cartoon-style illustration shows a confused student with orange hair shrugging in front of a computer screen. The screen displays a Python function with a missing indentation error:

Python Syntax

Learn Python syntax basics with clear examples and beginner-friendly practice exercises.

Python Variables

Python Variables

Learn Python variables with simple explanations, real-world analogies, practice tasks to build confidence using data in programs.