Skip to main content

A Gentle Introduction to Python

Adriel is a technology enthusiast. He enjoys programming and surfing the web.

Python code

Python code

Python

Python is a programming language that has become popular due to the demand for Machine Language and Artificial Intelligence applications.

Python is commonly used in data science for visualization.

What is Python?

Python is a high level programming language that was created by Guido Van Rossum in the eighties and early nineties. It has been increasing in popularity in the last few years.

It works on all major platforms and operating systems including:

  • Windows
  • MacOS
  • Linux
  • PlayStation


Pyhton logo

Pyhton logo

  • Python is a multi-purpose programming language. It can be used to create simulations, web-pages and embedded applications.
  • Python is an interpreted language. In Python, the code is saved in the same format it is typed.
  • Python is a dynamically typed language. You do not have to explicitly declare types.
  • Python is an open-source language and is free to use.
  • Python is an object oriented language.

Why Choose Python?

There are numerous reasons for choosing Python as your preferred programming language. Many programmers use a variety of programming languages to create applications. However, they prefer one or two core programming languages.

Reasons for choosing Python:

  • It is simple to learn. The syntax of Python is easier than other programming languages.
  • It is easy to read due to its simple syntax.
  • It is becoming very popular and thus it has a large community.
  • It is open-source.
  • It is highly extensible due to the large number of Python packages and libraries.
  • It can be used on all platforms.
  • It can be used in conjunction with other programming languages like Java, C, C++ and Java Script.
  • It can be used for various purposes such as data visualization, web development and application development.
  • Reduced development time due to the simple syntax and fewer lines of code.
  • It is easy to maintain
  • It is scalable.
  • It is portable and can run on a variety of platforms and hardware.
  • It is a very powerful and versatile programming language.


Companies that use Python

Python is very popular and large companies use it to develop applications and visualize data. Some of the largest companies in the world that use Python include:

  • Google
  • Spotify
  • NASA
  • Red Hat
  • New York Stock Exchange

Downloading Python

Python is maintained by the Python Software Foundation. It can be downloaded here: https://www.python.org

The python file contains the Python interpreter and a code editor called IDLE.

However, you will need a more advanced Integrated Development Environment like Pycharm, Jupyter Notebook or Spyder.

Installing Python

Open a your browser and open the following link http://www.python.org/download/

Scroll to Continue

Click the link for the Windows installer python-ABC.msi file where ABC is the version you will install.

To use the installer python-ABC.msi, the Windows operating system must support Microsoft Installer 2.0. Save the installer file to your computer and then run it.

Execute the downloaded file. The Python install wizard will appear to guide the installation process.

Remember to to check the "Add Python.exe to path" option to ensure that Python can execute from the command prompt.

Installing Anaconda

The Anaconda Distribution includes the Spyder Code Editor and the Python packages (such as SciPy, NumPy, Mat-plotlib).

You can download and install Anaconda from: https://www.anaconda.com

Installing Visual Studio Code

Visual Studio Code code is a simple and easy to use editor that can be used for

various programming languages.

You can download and install from: https://code.visualstudio.com

Python IDE

The code editor in Python is called the integrated development environment, called IDLE.

Your first Python Program

Open your favorite IDE or use the default IDLE and type the following:

print ("Hello World ! ")

The python program that is installed will by default act as an interpreter.

Python code can be executed from the command prompt or from the IDE.

Python Shell

The Python shell comes as standard with the python installation. The shell allows you to type code and execute it.

>>> print ("Hello World ! ")

Opening the Command prompt on Windows

Open the command prompt and type python. Click enter and Python’s Interpreter is launched.

You might get an error like ‘'python' is not recognized as an internal or external command,’

You need to add Python to path.

Add Python to Path

From the Windows menu, search for “advanced system settings" and choose View

advanced system settings.

In the window that appears, click Environment Variables. . .


Setting Environment Variables

Setting Environment Variables

In the following window and select the user variable named Path and click Edit. . . to change the value.

Choose "New" and add the path where "python.exe" is installed.

The Default Location is: C : \Users\user\AppData\Local\Programs\Python\Python 3.x.x

Click Save and open the Command Prompt again and type "python" to check if it works.


Python Path

Python Path

Environment Variable

Environment Variable

This content is accurate and true to the best of the author’s knowledge and is not meant to substitute for formal and individualized advice from a qualified professional.

© 2022 Adriel Ananiel

Related Articles