Python — Introduction

Archit Sharma
4 min readMay 13, 2021

Python. A widely used multi-purpose language that support various programming paradigms including object-oriented programming, procedural and functional programming. Famous for its highly readable code and a steady learning curve the language was named after a famous British comedy troupe. Being one of the most widely used language Python obviously is in quite high demand.

Why Python?

  1. Easy to learn:- Python does not require you to have any nuanced knowledge regarding the different hardware components (such as Memory or Hard Drive or RAM) nor do you need to know or understand OS and their workings. Being an interpreted language one also does not need to know about compilers. Python is designed to be easy to read and understand; it is perhaps the easiest language to learn.
  2. Easy to use:- Python has a very clear and highly readable syntax. There are numerous libraries dedicated to the varied numbers of tasks that can be performed using python.
  3. Community support:- Python has a vast and highly diverse community. The python community has had a great impact on development of Python as a programming language; there are countless 3rd party packages and libraries that are freely available for anyone to use and makes a lot of work easier.
  4. High demand:- When it comes to growth Python has out paced many languages in the field. It ranks in top 3 in the TIOBE index. IEEE has granted Python the highest spectrum rating for the third consecutive year.
  5. Multi-purpose:- Python has been used in various fields from special effects in movies to building sites for big tech its capabilities continues to grow tremendously. Python is widely used in Web Development, Data Science, Game Development, IoT, Application Scripting, GUI Development, Education Programs and many other fields.

Features

  1. Clear, concise and high readability:- As compared to other languages Python’s code is far more easy to understand and that is because unlike other programming languages that follow a C-like (or Java like) syntax Python uses a different style of syntax that is in accordance with the Zen of Python, unlike other languages Python does not use curly brackets ({}) instead it uses whitespace (indentation) to denote a block of code (usually 4 whitespaces).
  2. General purpose and high level:- It can be (& is) used in various fields of work as already discussed above. Also, like majority of other programming languages used today Python is also a High Level Language.
  3. Multi-paradigm:- Python supports 4 paradigms of programming namely imperative, functional, procedural, and object-oriented programming (some people combine imperative and functional coding styles while others view them as completely separate styles) and depending on the use case one can chose a single or even a combination of two or more. Detailed explanation of each paradigm and some basic use cases for the very same are discussed here.
  4. Interpreted:- Unlike C++ (which by many is undoubtedly considered as the fastest high level programming language) which is a compiled language, Python is an interpreted language. Generally for a given task a C++ program is much larger as compared to a Python one; for real life cases (a lot of time) the compile time can be way too long for the programmer to know if the code is doing what it is intended to do and to know if the programmer need to fix it, while on the other hand an interpreter is like a live translator that converts the code to machine level code in real time and hence the programmer knows what the code is doing and where to make fixes. Although Python is considered interpreted programming language it is a half truth compilation is a step in the conversion of high level instructions (program) to machine understandable code. Python code, which is written in a .py (extension) file, the code is first compiled to what is called bytecode which is stored with a .pyc or .pyo file. This bytecode is a low-level set of instructions that can be executed by an interpreter. In most PCs, Python interpreter is installed at /usr/local/bin/python3.8. Instead of executing the instructions on CPU, bytecode instructions are executed on a Virtual Machine.
  5. Garbage collected:- Unlike programming languages like C or C++, Python in its run time takes care of garbage collection. When the variables used are no longer in use or referenced anywhere else in the program, they need to be removed from the memory. Python’s Garbage Collector does exactly that for you. It automatically frees up space without you doing anything. Although this is not a beginner level concept, but it is quite an important one even from an interview perspective for more read here.
  6. Dynamically typed:- What this means is that type of a variable can change over its lifetime and that type checking happens at run time.

Advantages

  1. Presence of a Comprehensive Standard Library.
  2. Driven by community:- Python is a community driven and open source language. For more info read here.
  3. Availability of third party libraries and tools.

Disadvantages

  1. Slow as compared to languages like C++ and Java.
  2. At times runtime errors can be more difficult to diagnose. Python being a dynamically typed language lacks a compiler and errors usually occurs at run time.
  3. High memory usage, hence not suitable to be directly applied in the web browser and mobile platforms.

--

--

Archit Sharma
0 Followers

Currently pursuing my Bachelors. Love all things data.