1. Introduction
1. Introduction
Say you want to make instant coffee. You must get a mug, the instant coffee
jar, a teaspoon, water, and the kettle. Even if you are not aware of it, you are
evaluating a lot of data. You are making sure that there is water in the kettle
and that the kettle is plugged in, that the mug is clean, and that there is
enough coffee in the jar. Then, you boil the water and maybe, in the
meantime, you put some coffee in the mug. When the water is ready, you pour
it into the mug, and stir.
So, how is this programming?
Well, we gathered resources (the kettle, coffee, water, teaspoon, and mug)
and we verified some conditions concerning them (the kettle is plugged in, the
mug is clean, and there is enough coffee). Then we started two actions (boiling
the water and putting coffee in the mug), and when both were completed, we
finally ended the procedure by pouring water into the mug and stirring.
Features of Python
Easy to Learn
Python is one of the most user-friendly programming languages. One can easily
learn the basics of Python and become familiar with its syntax and be able to
write basic programs in a few days. However, learning the advanced concepts
and mastering python may take you some time. Compared to other languages
like C, C++, Java, etc., Python is the easiest language to learn and master.
Free and Open Source
Python is a free and open-source programming language, which means that it
can be used for free of cost on any operating system and without any copyright
issues. Anyone can download Python from its official website along with its
libraries and documentation. You can download, but it also allows you to make
your own modules or libraries and distribute them.
Portability
Python runs everywhere, and porting a program from Linux to Windows or
Mac is usually just a matter of fixing paths and settings. Python is designed for
portability and it takes care of specific operating system (OS) quirks behind
interfaces that shield you from the pain of having to write code tailored to a
specific platform.
Software quality
Python is heavily focused on readability, coherence, and quality. The
language's uniformity allows for high readability, and this is crucial nowadays,
as coding is more of a collective effort than a solo endeavor. Another
important aspect of Python is its intrinsic multiparadigm nature. You can use it
as a scripting language, but you can also exploit object oriented, imperative,
and functional programming styles—it is extremely versatile.
Software integration
Another important aspect is that Python can be extended and integrated with
many other languages, which means that even when a company is using a
different language as their mainstream tool, Python can come in and act as a
gluing agent between complex applications that need to talk to each other in
some way.
Databases Support
Today almost every application we need to develop certainly requires a
database and here comes the Python Database API (DB-API) that provides an
interface to almost most of the major commercial databases. Some of the
databases supported by standard python are MySQL, PostgreSQL, Microsoft
SQL, Oracle, Informix, etc. We need to import the interface for the database to
use it. Using Python, you can deal with both relational as well as non-relational
databases.
Large Standard Library
Python consists of a bulk of libraries that are cross-platform and provides a rich
set of modules and functions. These libraries are compatible with various
operating systems like UNIX, Mac, windows, etc. Due to the large number of
libraries, we need not write code for everything instead import and use the
functionality required. For example, if you need to access some websites and
want to scrape data from them, then you do not need to write the functions
for request, response, and other things, from scratch. There are various
libraries available for this purpose which you can use.
Dynamic Typed Language
Python is a Dynamically-Typed language. Dynamically-typed means that, unlike
other programming languages, in Python, we need not declare the data type
(for example, int, float, double, char, etc.) of a variable explicitly. The data type
of the variable is decided at the run time. Apart from this one variable can be
used to store different types of data at different instances in the program. This
feature of python saves a lot of time and helps us to avoid pitfalls that might
have occurred if it required the datatype to be mentioned explicitly.