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

Tests and debugging in VSCode

How to use the Visual Studio Code (VSCode) debugger.

In this video, you are provided with a tutorial on how to use the Visual Studio Code (VSCode) debugger to identify and fix errors in a piece of code. The video explains the concept of debugging and the role of breakpoints, which pause the code at a specific point to allow inspection of variables.

Your turn: debugging in VSCode

In this activity, you have one python file which contains a small error.
Download the Fix me.zip and open the Python file using Visual Studio Code.
You should use the skills you just saw in the video to try and find the error, which will make the tests pass – you should only edit the code itself, not the tests!
There are more instructions in the comments on the code which might help you if you are struggling.

IDEs give us an easy way to do lots of useful things to code, such as finding and fixing errors with the debugger, making code more readable using an autoformatter, and easily running code and tests. You’ve now seen how to set breakpoints, how to work out what’s going wrong in code, and where to look when you’ve got an error in your code – remember, often it’s in the loops!

This article is from the free online

Working with Integrated Development Environments (IDEs)

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