Introduction
Python is one of the world's most popular programming languages and is widely used in software development, data analytics, artificial intelligence, cybersecurity, automation, and scientific research.
Its simple syntax, readability, and large ecosystem make it an ideal first programming language for beginners.
However, many beginners struggle before they even write their first line of code. Common challenges include installing Python, configuring development tools, navigating folders, and running Python files successfully.
This guide focuses entirely on helping complete beginners set up Python and run their first programs. By the end of this tutorial, you will be able to:
- Install Python
- Verify your installation
- Use the Python interpreter
- Navigate folders using PowerShell
- Install Visual Studio Code (VS Code)
- Create Python files
- Run Python scripts
- Use Jupyter Notebook, Google Colab, and Kaggle
Understanding the Python Ecosystem
Before installing anything, it is important to understand that Python itself is different from the tools used to write code.
Python is the programming language and interpreter that executes your code.
Development environments such as:
- Visual Studio Code (VS Code)
- Jupyter Notebook
- Google Colab
- Kaggle Notebooks
- Sublime Text
are simply places where you write and run Python code.
A useful analogy is:
- Python = Engine
- VS Code, Jupyter, Colab = Vehicles that use the engine
Installing VS Code alone does not install Python. Both must be available if you want to work locally on your computer.
Installing Python
The first step is installing Python.
Windows Installation
- Visit the Python Downloads page:
https://www.python.org/downloads/
Download the latest stable version.
Run the installer.
Wait for the installation to complete.
Adding Python to PATH is one of the most important steps. Without it, your computer may not recognize Python commands in PowerShell or Command Prompt.
Verifying the Installation
After installation, open PowerShell.
Run:
python --version
Example output:
Python 3.15.0
If a version number appears, Python was installed successfully.
If an error appears, Python was either not installed properly or was not added to the PATH.
Using the Python Interactive Shell
After installation you can run Python directly.
Open PowerShell and type:
python
You should see something similar to:
Python 3.15.0
>>>
This is called the Python Interactive Shell.
Try executing:
print("Hello World")
Output:
Hello World
To exit the Interactive Shell:
quit()
or
exit()
You will return to PowerShell.
Essential PowerShell Commands
Before running Python files, you must know how to navigate folders.
Display Current Folder
pwd
Example:
C:\Users\Student
View Files and Folders
dir
Example:
Documents
Downloads
Python101
Change Directory
cd Documents
or
cd Python101
These commands help you locate and execute Python programs.
Installing Visual Studio Code
Although Python can be used directly from PowerShell, most developers use an editor.
Visual Studio Code (VS Code) is one of the most popular free code editors available.
Download VS Code from:
https://code.visualstudio.com/
Installation Steps
- Download VS Code.
- Install it.
- Open VS Code.
- Open the Extensions panel.
- Install:
- Python (Microsoft)
- Jupyter (Microsoft)
These extensions provide syntax highlighting, IntelliSense, notebook support, debugging tools, and code execution features.
Creating Your First Python Project
Create a folder named:
Python101
Open the folder inside VS Code.
Create a file named:
main.py
The .py extension identifies the file as a Python script.
Enter the following code:
print("Hello World")
Save the file:
Ctrl + S
Your first Python program is now ready.
Running a Python File from PowerShell
Open PowerShell.
Navigate to the folder containing your program.
Example:
cd Documents\Python101
Run the file:
python main.py
Output:
Hello World
Congratulations!
You have successfully run your first Python program.
Running Python Files inside VS Code
VS Code provides an easier way to execute programs.
- Open your project folder.
- Open
main.py. - Click Run Python File.
- The terminal opens automatically.
- Output appears in the terminal.
Example:
print("Python is working!")
Output:
Python is working!
VS Code automatically handles many tasks that beginners usually perform manually.
Running Python in Jupyter Notebook
Jupyter Notebook allows Python code to be executed in individual cells.
Install Jupyter:
python -m pip install notebook
Launch Jupyter Notebook:
jupyter notebook
A browser window opens automatically.
Create a notebook and enter:
print("Hello from Jupyter")
Run the cell using:
Shift + Enter
Output:
Hello from Jupyter
Jupyter Notebook is especially useful for experimentation, learning, and data analysis.
Running Python in Google Colab
Google Colab is Google's cloud-based notebook environment.
Visit:
https://colab.research.google.com
Sign in using a Google account.
Create a new notebook and enter:
print("Hello from Colab")
Run the code using:
Shift + Enter
Output:
Hello from Colab
Advantages of Google Colab
- No installation required
- Free to use
- Accessible from any device
- Automatic saving to Google Drive
It is ideal for beginners who do not want to install software immediately.
Running Python in Kaggle Notebooks
Kaggle provides another cloud-based environment for running Python.
Visit:
Create an account and then:
- Open Notebooks.
- Create a new notebook.
- Enter Python code.
- Execute code cells.
Kaggle is particularly useful when working with datasets and machine learning projects.
Common Setup Problems and Solutions
Problem 1: Python Command Not Found
Error
'python' is not recognized as an internal or external command
Solution
Reinstall Python and ensure:
Add Python to PATH
is selected during installation.
Problem 2: Cannot Find Python File
Error
can't open file main.py
Solution
Navigate to the correct folder:
cd Python101
Then run:
python main.py
Problem 3: Changes Do Not Appear
Cause
The file was not saved.
Solution
Press:
Ctrl + S
before executing the script.
Problem 4: VS Code Cannot Detect Python
Solution
Press:
Ctrl + Shift + P
Type:
Python: Select Interpreter
Choose the Python version you installed.
Recommended Beginner Workflow
A practical workflow is:
- Install Python.
- Verify installation.
python --version
- Install VS Code.
- Create a project folder.
- Create a
.pyfile. - Write code.
- Save using
Ctrl + S. - Run using:
python filename.py
- Practice using Jupyter Notebook or Google Colab.
Following this workflow will help you build confidence and avoid common beginner mistakes.
Conclusion
Setting up a Python development environment is the first and most important step in becoming a Python programmer.
In this guide, you learned how to install Python, verify the installation, use PowerShell commands, create Python files, and run programs using VS Code, Jupyter Notebook, Google Colab, and Kaggle.
Many beginners assume programming starts with writing code. In reality, successful programming starts with understanding your tools and knowing how to execute programs correctly.
Once you can confidently install Python, create files, and run programs, you are ready to begin learning core Python concepts such as variables, data types, operators, user input, and program logic.
For now, focus on mastering setup and execution. Every experienced Python developer started exactly where you are today—with a simple "Hello World" program.
Top comments (0)