Python installation is a straightforward process, and there are multiple ways to do it depending on your operating system and requirements.
To install python on your system, follow below steps:
Visit the official Python website at https://www.python.org/downloads/.
Download the appropriate and recommended Python installer for your operating system (Windows, macOS, or Linux) and Choose the version of Python you want to install. As per latest update, Python 3.x.x is recommended for most users.
Once the download is complete, locate the installer and double-click on it to run the installer.
Follow the on-screen instructions to install Python.
On Windows, Make sure to check the box that says "Add Python 3.x.x to PATH" during installation to ensure Python is added to our system's "PATH" environment variable and the PATH variable allows you to run Python from the command line.
After installation, we can verify that Python is installed correctly by opening a command prompt (on Windows) or a terminal (on macOS or Linux).
This should display the installed Python version.
python3 --version #Check Python Version: Type python --version or python3 --version in the terminal (or py --version on Windows).
Python 3.12.1
Python comes with a package manager called pip that allows us to easily install additional packages.
We can install packages using "pip" by running commands like "pip install package_name".
Python Interpreter: The Python installer includes the Python interpreter, which executes Python code line by line.
pip: The Python Package Installer (pip) is a tool used to install additional packages or dependencies and manage Python packages.
PATH: Adding Python to the system `PATH` allows us to run Python and pip from the command line without specifying the full path to the executable file.
Version: Verify the Python version to ensure that the correct version was installed on our machines and is accessible from the command line.
That's it! we have successfully installed Python on your system. We can now start writing and running Python code.