Introduction
Python is one of the most popular programming languages in the world. Before building Artificial Intelligence, Machine Learning, Data Science, or Automation projects, the first practical step is installing Python on your computer.
Python installation allows your system to understand and execute Python programs. Once Python is installed, you can start writing code, running applications, and using powerful libraries for AI development.
Learning Objectives
- Understand Python installation
- Download Python from the official website
- Install Python on Windows
- Verify Python installation
- Run Python from Command Prompt
- Execute your first Python program
What is Python Installation?
Python installation means setting up the Python software environment on your computer so that you can write and run Python programs.
Computers cannot directly understand Python code. Python requires a software component called the Python Interpreter to execute code.
Example:
print("Hello Python")
Output:
Hello Python
The Python Interpreter reads the code and produces the output.
Why Do We Need to Install Python?
Installing Python is important because it enables developers and learners to:
- Write and execute Python programs
- Build Artificial Intelligence and Machine Learning projects
- Use Python libraries and frameworks
- Create automation scripts and applications
- Practice coding and software development
Without installing Python, you cannot run Python code on your local machine.
How to Install Python on Windows
Step 1: Visit the Official Python Website
Open your web browser and visit the official Python website:
https://www.python.org
Step 2: Download Python
Click on the Downloads section.
You will see the latest stable version of Python available for download. Click the download button to download the installer file.
Step 3: Run the Installer
After downloading, open the installer file.
Before clicking install, make sure to enable the following option:
Add Python to PATH
This option is very important because it allows Python to run directly from the Command Prompt.
Step 4: Install Python
Click the Install Now button.
The installation process will begin and may take a few minutes depending on your system.
Step 5: Complete Installation
After the installation is completed, a success message will appear on the screen.
This confirms that Python has been installed successfully.
How to Verify Python Installation
After installation, you should verify that Python is working correctly.
Open Command Prompt and type:
python --version
Example Output:
Python 3.12.4
If the version number appears, Python has been installed successfully.
Running Python from Command Prompt
To start the Python interactive shell, open Command Prompt and enter:
python
Now you can directly execute Python commands.
Example:
print("Welcome to Python")
Output:
Welcome to Python
Python Example
Let’s run a simple Python program:
num1 = 10
num2 = 20
total = num1 + num2
print("Total:", total)
Output:
Total: 30
Real-World Applications
- Data Scientists use Python for data analysis.
- AI Engineers use Python to build machine learning models.
- Web Developers use Python frameworks such as Django and Flask.
- Automation Engineers create scripts to automate repetitive tasks.
- Cybersecurity professionals use Python for security testing and analysis.
Key Concepts
- Python installation sets up the Python environment.
- Python Interpreter executes Python code.
- Python should always be downloaded from the official website.
- “Add Python to PATH” is an important installation option.
- Command Prompt can be used to verify installation.
Summary
In this tutorial, you learned how to install Python, verify the installation, and execute your first Python program. Installing Python is the first practical step toward learning Artificial Intelligence, Machine Learning, Data Science, and Software Development.
Next Tutorial
Module 2.4: Python IDEs
“`
