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
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
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.
Items | Compiled Langauge | Interpreted Language |
---|---|---|
Explanations | 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. |
Programming languages | C, C++, Golang, Pascal, assembly, etc. | Python, Javascript, PHP, Shell, MATLAB, etc. |
Advantages | 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.) |
Disadvantages | It is not flexible. | It is inefficient due to conversion while executing. |
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:
More Tutorials:
Python Installation - Linux (Ubuntu)More Python Exercises:
Python String Exercises