paint-brush
Basic Python featuresby@nitin-vishwakarma
1,189 reads
1,189 reads

Basic Python features

by Nitin VishwakarmaNovember 14th, 2019
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Python is the most wanted language for the third year in a row, according to Stack overflow. Python is used in academia, at web companies, in large corporations and financial institutions. It is being used in the field of machine learning, where machines are trained to learn from the historical data and act according to some new data. Python has a gentler learning curve (compared to languages like C, Java, etc.) due to its simple syntax. It uses natural language elements, is easier to use, automates significant areas of computing systems such as resource allocation. Python code appears like pseudo-code and allows us to concentrate on the solution to the problem rather than the language itself.
featured image - Basic Python features
Nitin Vishwakarma HackerNoon profile picture

When you say, what could be the future of programming or which programming language will boom, it should be Python, always. Just look at the 2019 survey from Stack overflow. It is quite obvious that python is taking the lead now.

For the seventh year in a row, JavaScript is the most commonly used programming language, but Python has risen in the ranks again.
This year, Python just edged out Java in the overall ranking, much like it surpassed C# last year and PHP the year before. Python is the
fastest-growing major programming language today, and look at where is
PHP.


Python is the most wanted language for the third year in a row, meaning that developers who do not yet use it say they want to learn it.

Current Scenario:

Apart from its huge applications in the field of web and software
development, one of the reasons why Python is being extensively used
nowadays is due to its applications in the field of machine learning,
where machines are trained to learn from the historical data and act
accordingly on some new data.

Hence, it finds its use across various domains such as Medicine (to learn and predict diseases), Marketing(to understand and predict user behavior)
and now even in Trading (to analyze and build strategies based on
financial data).

Use of Python:

Python is used by the novice programmer as well as by the highly skilled
professional developer. It is being used in academia, at web companies,
in large corporations and financial institutions. It is used for,

  • Web and Internet development: Python is used on the server-side to create web applications.
  • Software development: Python is used to create GUI applications, connecting databases, etc.
  • Scientific and Numeric applications: Python is used to handle big data and perform complex mathematics.
  • Education: Python is a great language for teaching programming, both at the introductory level and in more advanced courses.
  • Desktop GUIs: The Tk GUI library2 included with most binary distributions of
    Python is used extensively to build desktop applications.
  • Business Applications: Python is also used to build ERP and eCommerce systems.

Why Python?

  • Simple: Compared to many other programming languages, coding in
    Python is like writing simple strict English sentences. In fact, one of its oft-touted strengths is how Python code appears like pseudo-code. It allows us to concentrate on the solution to the problem rather than the language itself.
  • Easy to learn: As we will see, Python has a gentler learning curve (compared to languages like C, Java, etc.) due to its simple syntax.
  • Free and open source: Python and the majority of supporting libraries available are
    open source and generally come with flexible and open licenses.
    It is an example of a FLOSS(Free/Libré and Open Source Software). In layman terms, we can freely distribute copies of open source software, access its source code, make changes to it, and use it in new free programs.
  • High-level: Python is a programming language with strong abstraction from
    the details of the underlying platform or the machine. In contrast to low-level programming languages, it uses natural language elements, is easier to use, automates significant areas of computing systems such as resource allocation. This simplifies
    the development process when compared to a lower-level language. When we write programs in Python, we never need to bother about the lower-level details such as managing the memory used by programs we write, etc.
  • Dynamically Typed: Types of variables, objects, etc. in Python are generally inferred
    during runtime and not statically assigned/declared as in most of the other compiled languages such as C or Fortran.
  • Portable: Being open source and also with support across multiple platforms, Python can be ported to Windows, Linux and Mac. All Python programs can work on any of these platforms without requiring any changes at all if we are careful in avoiding any platform-specific dependency. It is used in the running of powerful severs and also small devices like the Raspberry Pi3.
  • Interpreted: A programming language can be broadly classified into two
    types viz. compiled or interpreted. A program written in a compiled language like C or C++ requires the code to be converted from the original language (C, C++, etc.) to a machine-readable language (like binary code i.e. 0 and 1) that is understood by a computer using a compiler with various flags and options. This compiled program is then fed to a computer memory to run it. Python, on other hand, does not require compilation to machine language. We directly run the program from the source code.
    Internally, Python converts the source code into an intermediate form known as byte code and then translates this into the native language of the underlying machine. We need not worry about proper linking and the loading into memory. This also enables
    Python to be much more portable, since we can run the same program onto another platform and it works just fine!
  • Garbage Collection – Python takes care of memory allocation and deallocation on its own. In other words, a programmer does not have to manage memory allocation and need not have to preallocate and deallocate memory before constructing variables and objects. Additionally, Python provides Garbage Collector6 interface to handle garbage collection.