Python Basics: Your First Steps Into Programming
First Steps in VS Code
Lesson 3 of 16 • 10 XP
Keep your place in this quest
Log in or sign up for free to subscribe, follow lesson progress, and access more learning content.
Now that Python and VS Code are installed, let’s get comfortable with our main development environment. VS Code will be your “home base” for coding — it’s where you’ll write, organize, and run your programs.
Opening a Project Folder
In VS Code, everything you work on is part of a folder. This is called your workspace, and it helps keep all your code, images, and other files together.
- Open VS Code.
- Click on File → Open Folder.
- Choose or create a folder where your Python files will live (for example, “PythonProjects”).
- Click Select Folder and you’ll see it listed in the Explorer panel on the left.
TIP: Keep one folder per project. This avoids confusion and makes it easier to share your work later.
Creating Your First Python File
Python files always end with the .py extension.
To create one:
- In the Explorer panel, click the “New File” icon.
- Name your file something like
hello.py. - Inside, type:
print("Hello, Python!")
Note: The file name should not contain spaces. Use underscores _ or camelCase instead. Don't worry about the details yet: we will study all this in depth soon!
Understanding the Integrated Terminal
The integrated terminal in VS Code lets you run your programs without switching to another app.
- Open it with View → Terminal or press Ctrl + ` (that’s the backtick key, usually above Tab).
- You’ll see a terminal open at the bottom of VS Code.
- Make sure the terminal is in your project folder — it should show the same path you opened in the Explorer.
To run your Python file:
python hello.py
(or python3 hello.py on some systems, like Linux)
You should see:
Hello, Python!
IMPORTANT!: If “python” is not recognized, it means your PATH isn’t set correctly. You can fix it by reinstalling Python and ensuring “Add Python to PATH” is checked.