PYTHON

Introduction

There are two kinds of language that a machine understands:

i) Low-Level Language

ii) High-Level Language

Low-Level Languages referred to as machine languages or assembly languages. Computers execute the programs written in a low-level language, therefore, interpreter and compilers convert high-level languages into a low-level language.

There are further two categories of High-Level languages:

  1. Programming Language
  2. Scripting Language

The programming language compiles and, later executed by the interpreter whereas scripting language has runtime compilation features.

The illustration reflects the hierarchy of Hardware and High- Level Languages.

By now, you probably got the feeling that "Python is one of the high-level languages" used for solving the problems. It's widely accepted by the beginners as it's syntax is easy to learn unlike other programming langauges.

INSTALLATION ON UNIX

Unix operating system has preinstalled Python. If you are using recent version of Ubuntu, then Python 3 is a part of OS. Otherwise update the Python.

sudo apt-get update sudo apt-get install python3.6

If the Version of Ubuntu is < 16.10

sudo add-apt-repository ppa:deadsnakes/ppa sudo apt-get update sudo apt-get install python3.6

INSTALLATION ON WINDOWS

  1. Download the Python 3.6 installer from here.

  2. Run the installer. Python Installation

  3. Click on 'Install Now'. And wait till the installation completed. Python Installation Completed

GET STARTED WITH PYTHON

Python 3.6 installed on your system. In order to check the Python is added to the path, go to the Command line (Windows) or Terminal (on Unix and Mac) and run the following:

python -V

Python Hello World Program

Open a blank file, and write print("Hello World") and save the file as HelloWorld.py

print ("Hello World")

Execute the following from the command line.

python HelloWorld.py

SUMMARY

In this article we learn about