Basic Introduction of C 1

Basic Introduction of Python

Basic Introduction of Python starts from understanding how computers and programming language work. In the literal sense of the word, a computer is nothing more than a device that performs simple operations through sequences of electrical signals. These signals are generated through two indicators (for example, the lowest or highest possible voltage).

These signals are interpreted by the computer as “something or nothing” and they can be represented digitally using sequences of numbers based on two values 0 and 1. This is called the binary system, as it uses only two digits.

We now know that the computer internally operates using binary numbers and does not deal with anything else. Therefore, all information (including code) must be converted into binary form. This applies not only to the data we process (such as text, images, sounds, and numbers), but also to programs themselves (the sequences of instructions that tell the computer what to do).

What is machine Language?

Machine language is a language which is based only on binary digits (0s and 1s).

The only language that the computer truly understands is machine language. 0s and 1s are called bits. Bits are grouped into larger units for processing, such as 8 bits (a byte), 16 bits, 32 bits, and 64 bits. These groups are used to represent both data and instructions that the computer can execute.

This machine language is generally incomprehensible to us. We have developed programming languages to interact with computers.

What is a programming language?

A programming language consists of a set of keywords (chosen arbitrarily) along with rules that define how to combine them into statements that can be translated into machine language.

Classification of Programming languages

Programming languages are classified by levels:

  • Low-level languages (such as assembly language), which are very close to machine language
  • High-level languages (such as C, C++, Java, Pascal, Perl and Python), which are more abstract and powerful

Low-level languages consist of very basic instructions that are close to machine operations. High-level languages, on the other hand, are more abstract and expressive.

This means that a single instruction in a high-level language may be translated into many low-level machine instructions.

What kind of language is python? High level language or low level language!

Python is a high-level language. It is translated into complex binary code, and this process usually takes some time. In contrast, low-level programs are tied to specific hardware and must often be rewritten entirely to run on another machine.

We know from above, computers can only run programs written in low-level languages. Therefore, programs written in high-level languages must first be processed before they can run. This processing takes some time, but it is only a small drawback compared to the advantages of high-level languages.

How high-level languages are translated into machine language?

To communicate with the computer, we use translation systems capable of converting the words we understand (usually in English) into sequences of binary numbers that the computer can process.

These translation systems are built based on sets of rules and terminology, and they differ depending on how translation is performed. There are two types of programs that translate high-level languages into machine language:

Interpreters

An interpreter reads a program written in a high-level language and executes it line by line, translating and performing the operations immediately.

Compilers

A compiler reads the entire program and translates it completely before execution. In this context:

  • The program written in a high-level language is called the source code
  • The translated program is called the object code or executable program

Once compiled, the program can be run multiple times without needing to be translated again.

What makes Python so great language?

At first glance, python being a high level language may seem like a disadvantage, but in reality, high-level languages like python offer many advantages:

Open source:

First, Python is open-source freeware, meaning you can download it for free and use it for any purpose, whether commercial or non-commercial.

Amazing community:

Python also has an amazing community that has built many useful tools that you can use in your own programs. Need to work with PDF documents? There is a complete tool for that. Want to collect data from web pages? No need to build a tool from scratch for this purpose! There is also tool available for it and many more.

Coding is Easy and Fast:

Python is designed to be easier to use compared to other programming languages. Generally, Python code is easier to read, and writing code in Python is much faster than in other languages. The programs are shorter and are less prone errors. They are easier to maintain and debug. For example, here is a basic piece of code written in C, another commonly used programming language:

#include 
int main(void)
{
    printf("Hello, World\n");
}

This program simply displays the text “Hello, World” on the screen. That’s quite a bit of work just to output one phrase! Now, here’s the same program written in Python:

print("Hello, World")

That looks pretty simple, right? Python code is faster to write and easier to read. We also find it more user-friendly and understandable!

Full of functionalities:

At the same time, Python has all the functionalities of other languages and even more. You might be surprised to learn how many professional software applications are built using Python, including Instagram, YouTube, Reddit, and Spotify, to name a few.

Career opportunities:

Python is not only a friendly and fun language to learn, but it also serves as the backbone of technology for many top companies and offers fantastic career opportunities for any programmer who masters it!

Portability:

Programs written in python can run on different types of computers with little or no modification. In contrast, low-level languages are tied to a specific type of computer, and programs must be rewritten to run on another machine. For these reasons, almost all programs are written in high-level languages, although low-level languages are still used in certain specialized applications.

In the next article you will read about How to install python on your computer ways to run python codes.

No Comments

Leave a Reply