Windows

  1. Download the Installer:

  2. Run the Installer:

    • Open the downloaded .exe file.
    • Make sure to check the box that says “Add Python to PATH”.
    • Click “Install Now”.
  3. Verify the Installation:

    • Open Command Prompt.
    • Type python --version and press Enter.
    • You should see the installed Python version.
  4. Hello World:

    • Open a text editor and write the following code:
        print("Hello, World!")
        
    • Save the file as hello.py.
    • Open Command Prompt, navigate to the directory where you saved hello.py, and run:
        python hello.py
        
    • You should see the output:
        Hello, World!
        

Linux

Using apt (Debian/Ubuntu)

  1. Update Package List:

    • Open your terminal.
    • Run the following command:
        sudo apt update
        
  2. Install Python:

    • Run the following command:
        sudo apt install python3
        
  3. Verify the Installation:

    • Type python3 --version and press Enter.
    • You should see the installed Python version.
  4. Hello World:

    • Open a text editor and write the following code:
        print("Hello, World!")
        
    • Save the file as hello.py.
    • Open Terminal, navigate to the directory where you saved hello.py, and run:
        python3 hello.py
        
    • You should see the output:
        Hello, World!
        

Using yum (RHEL/CentOS/Fedora)

  1. Update Package List:

    • Open your terminal.
    • Run the following command:
        sudo yum check-update
        
  2. Install Python:

    • Run the following command:
        sudo yum install python3
        
  3. Verify the Installation:

    • Type python3 --version and press Enter.
    • You should see the installed Python version.
  4. Hello World:

    • Open a text editor and write the following code:
        print("Hello, World!")
        
    • Save the file as hello.py.
    • Open Terminal, navigate to the directory where you saved hello.py, and run:
        python3 hello.py
        
    • You should see the output:
        Hello, World!
        

Mac

  1. Download the Installer:

  2. Run the Installer:

    • Open the downloaded .pkg file and follow the installation instructions.
  3. Verify the Installation:

    • Open Terminal.
    • Type python3 --version and press Enter.
    • You should see the installed Python version.
  4. Hello World:

    • Open a text editor and write the following code:
        print("Hello, World!")
        
    • Save the file as hello.py.
    • Open Terminal, navigate to the directory where you saved hello.py, and run:
        python3 hello.py
        
    • You should see the output:
        Hello, World!
        

Using Homebrew (Alternative for Mac)

  1. Install Homebrew (if you don’t have it already):

    • Open Terminal and run:
        /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
        
  2. Install Python:

    • Run the following command:
        brew install python
        
  3. Verify the Installation:

    • Type python3 --version and press Enter.
    • You should see the installed Python version.
  4. Hello World:

    • Open a text editor and write the following code:
        print("Hello, World!")
        
    • Save the file as hello.py.
    • Open Terminal, navigate to the directory where you saved hello.py, and run:
        python3 hello.py
        
    • You should see the output:
        Hello, World!