π» Install Python on Windows
Step 1: Download Python
- Open your web browser.
- Go to the official Python website:
Python - Click Downloads.
- Download the latest Python version for Windows.
Step 2: Run the Installer
- Open the downloaded installer file.
- Check the box “Add Python to PATH” βοΈ
- Click Install Now.
This will install Python and its required components on your system.
Step 3: Verify Installation
After installation, open Command Prompt and type:
python --version
If Python is installed correctly, it will display something like:
Python 3.x.x
π Install Python on macOS
Step 1: Download Python
- Visit the official website:
Python - Download the macOS installer.
Step 2: Install Python
- Open the downloaded
.pkgfile. - Follow the installation instructions.
Step 3: Verify Installation
Open Terminal and run:
python3 --version
π§ Install Python on Linux
Many Linux distributions already include Python.
Check if Python is installed
Open the terminal and type:
python3 --version
Install Python (if not installed)
For Ubuntu / Debian:
sudo apt update
sudo apt install python3
For Fedora:
sudo dnf install python3
π§ͺ Running Your First Python Program
After installation, you can test Python by running a simple program.
Open a terminal or command prompt and type:
python
Then enter:
print("Hello, Python!")
Output:
Hello, Python!
π Recommended Python Code Editors
You can write Python programs using different editors such as:
- Visual Studio Code π»
- PyCharm β‘
- Sublime Text β¨
- Notepad++