Featured

Getting Started with Python: A Beginner's Guide to Python Programming

Getting Started with Python: A Beginner's Guide to Python Programming

Dharambir
Dharambir
1 January 2025 min read
TechnologyProgrammingPythonSoftware DevelopmentCoding Tutorials

Python is a high-level programming language widely used for general-purpose programming. Created by Guido van Rossum, Python was first released in 1991. It features a dynamic type system, automatic memory management, and supports multiple programming paradigms including:

  • Object-oriented programming (OOP)
  • Imperative programming
  • Functional programming
  • Procedural programming

Python has a large and comprehensive standard library, making it versatile and easy to work with across various domains.

Two Major Versions of Python

There are two main versions of Python in use today:

1. Python 3.x (Current Version)

  • Active development and support.
  • Python 3 is the recommended version for all new projects, as it introduces many improvements and new features over Python 2.

2. Python 2.x (Legacy Version)

  • The legacy version of Python that is no longer being actively developed.
  • It will only receive security updates until 2020 and no new features will be added.
  • While many projects still use Python 2, transitioning to Python 3 is becoming increasingly easier.

To help ease setup for common use cases like math, data analysis, or scientific computing, some third-party vendors offer re-packaged versions of Python that include commonly used libraries.

You can check the official site for a list of these versions.

How to Download and Install Python

You can download and install either version of Python from the official Python website. You can also check out the Python 3 vs. Python 2 page for a comparison between them to determine which version you should install.

Verifying Python Installation

Once you have installed Python, it’s important to verify that the installation was successful.

Verify Python Version

To confirm that Python is installed correctly, open your terminal and run the following command:

$ python --version

Expected Output:

Python 3.x Version (≥ 3.0)

If Python 3 is installed, and it is the default version, the output should look like this:

$ python --version
Python 3.6.0

Python 2.x Version (≤ 2.7)

If you have Python 2 installed as the default version, the output will look like this:

$ python --version
Python 2.7.13

Using Python 3 Explicitly

If you have installed Python 3 but the $ python --version command outputs Python 2.x, this usually means that Python 2 is still installed. This is a common situation on macOS and many Linux distributions. In this case, you can explicitly call Python 3 by using the following command instead:

$ python3 --version
#Pyhton programming#Python 3#Python 2#Python installation#Coding for beginners#Programming languages#Python tutorial#Data analysis#Software development#Python tips
Share:
Dharambir

Dharambir