Sitemap

Introduction to Python

2 min readJul 20, 2023

--

Press enter or click to view image in full size

Python is an interpreted, object-oriented, high-level programming language. It was created by Guido van Rossum in 1991. The first reason to learn Python was that it is, in fact, a beautiful programming language. We can use coding in Python in multiple ways: data science, web development, and machine learning etc.

Why Python

Press enter or click to view image in full size
  1. Easy to code.
  2. Easy to understand.
  3. Free of cost.
  4. Huge collection of Libraries.
  5. General purpose programming language.

Python — Basics

Statements: Instruction which a python engine can executable

  1. Single Line Statement.
  2. Multiple Statement in a Single Line.
  3. Single Statement in Multiple Line.

Comments: Instruction not executed by the python engine

Get Psuryachinni’s stories in your inbox

Join Medium for free to get updates from this writer.

there are two types of comments:

  1. Single Line Comment
  2. Multi-Line Comment

Python Work Flow

Press enter or click to view image in full size
work flow of python

Python doesn’t convert its code into machine code, It actually converts it into something called byte code. this byte code can’t be understood by the CPU. So we need an interpreter called the python virtual machine to execute the byte codes.

The Python source code goes through the following to generate an executable code :

Step 1: The python compiler reads a python source code . Then it verifies that the instruction is well-formatted, it checks the syntax of each line. If it find out an error, it immediately stops the translation and shows an error message.

Step 2: If there is no error, i.e. if the python instruction or source code is well-formatted then the compiler translates it into an intermediate language called “Byte code”.

Step 3: Byte code is then sent to the Python Virtual Machine(PVM) which is the python interpreter. PVM converts the python byte code into machine-executable code. If an error occurs during this interpretation then the conversion is stopped with an error .

Step 4: Machine executable code transfers to computer and it gives required output.

--

--