Python is an open and free scripting programming language. It is easy to use but also powerful.
The Python programming language is like a english paragraph, thus non-professionals can also use Python.
This chapter introduces the basics related to Python programming and also involves data science related packages.
Program is a series of instructions/steps that tell computer what to do because computer cannot understand human
languages. Computer scientists have designed some symbols named as programming languages to communicate effectively with
computer. The examples of high level programming languages such as Python, C, C ++, Java, Ruby, etc.
Programming languages has two levels, high level and low level. High level languages are imperative languages,
functional languages, declarative languages, and object-oriented languages. While as, low level languages constituent
machine language and assembly language. Usually, high level language will similar as english language.
The high level programming languages are designed for programmers to understand and use easily.
In fact, computer hardware can only understand very low-level programming language named as machine language.
Machine languages are binary language in form of 0 and 1. The performance of low level language better than
high level language, but it is extremely difficult to write low level language.
The high level language needs to have both compiler and interpreter for converting purpose. They are languages
which computer cannot understand hence the compiler shall be used to convert into binary form. As highlighted
in the previous paragraph, the low level languages are in binary form thus no compiler is required for conversion
purpose therefore only interpreter are required by low level languages. Let's further find out the different
between computer and high-level programming languages to perform a sum operation between two numbers.
Example 1: Computer to perform a sum operation between two numbers
First number located in the memory space at 001 being loaded into the CPU.
Next, second number located in the memory space at 002 being loaded into the CPU.
Perform a sum operation on these two numbers in the CPU.
Lastly, store the result of summation at location 003.
The example 1 just a general description and in fact it is more complicated in actual situation.
Example 1: High-level programming languages such as Python to perform a sum operation between two numbers
Summation of two numbers can be expressed as z = x + y.
Next, using either compiler or interpreter to convert High-level Programming Language (Python) into Machine Language
A high-level language that uses a compiler to translate itself into machine language is called compiled language. Whileas,
a high-level language that uses an interpreter to convert itself into machine language is called an interpreted language.
The difference between compiled and interpreted languages
Programming languages require all source code be converted into binary instruction, which is
executed by a specific platform (Windows, Linux, etc.) at one time in advance.
Programming languages can be converted while executing.
C, C++, Golang, Pascal, assembly, etc.
After compiling once, it can run without the compiler, and it runs efficiently.
It is better performance in cross-platform. The same source code able to be interpreted through different
interpreters into machine code on different platforms (Windows, Linux, etc.)
It is not flexible.
It is inefficient due to conversion while executing.
Execution Flow of Compiled and Interpreted Languages
What is Program Steps and Program Flow?
The program steps is like a recipe or instruction, where a program is a sequence of steps
to be done in order. Usually, they are two types of steps which under conditional flow:
Skipped: Sometimes one or some program steps may be skipped if under certain condition
Repeated: Sometimes the program steps can be stored and to be used repeated if under certain condition