what is python ?
Published: 2021-01-19 11:06:52

Python’s key advantages 
Python’s success revolves around several advantages it provides for beginners and experts alike.

Python is easy to learn and use
The number of features in the language itself is modest, requiring relatively little investment of time or effort to produce your first programs. The Python syntax is designed to be readable and straightforward. This simplicity makes Python an ideal teaching language, and it lets newcomers pick it up quickly. As a result, developers spend more time thinking about the problem they’re trying to solve and less time thinking about language complexities or deciphering code left by others.


Python is broadly adopted and supported
Python is both popular and widely used, as the high rankings in surveys like the Tiobe Index and the large number of GitHub projects using Python attest. Python runs on every major operating system and platform, and most minor ones too. Many major libraries and API-powered services have Python bindings or wrappers, letting Python interface freely with those services or directly use those libraries. 

Python is not a “toy” language
Even though scripting and automation cover a large chunk of Python’s use cases (more on that later), Python is also used to build professional-quality software, both as standalone applications and as web services. Python may not be the fastest language, but what it lacks in speed, it makes up for in versatility.

Python keeps moving forward
Each revision of the Python language adds useful new features to keep pace with modern software development practices. Asynchronous operations and coroutines, for instance, are now standard parts of the language, making it easier to write Python apps that perform concurrent processing.
What Python is used for
The most basic use case for Python is as a scripting and automation language. Python isn’t just a replacement for shell scripts or batch files; it is also used to automate interactions with web browsers or application GUIs or to do system provisioning and configuration in tools such as Ansible and Salt. But scripting and automation represent only the tip of the iceberg with Python.

General application programming with Python
You can create both command-line and cross-platform GUI applications with Python and deploy them as self-contained executables. Python doesn’t have the native ability to generate a standalone binary from a script, but third-party packages like cx_Freeze and PyInstaller can be used to accomplish that.

Data science and machine learning with Python
Sophisticated data analysis has become one of fastest-moving areas of IT and one of Python’s star use cases. The vast majority of the libraries used for data science or machine learning have Python interfaces, making the language the most popular high-level command interface to for machine learning libraries and other numerical algorithms.
How Python makes programming simple
Python’s syntax is meant to be readable and clean, with little pretense. A standard “hello world” in Python 3.x is nothing more than:

print(“Hello world!”)
Python provides many syntactical elements to concisely express many common program flows. Consider a sample program for reading lines from a text file into a list object, stripping each line of its terminating newline character along the way:

with open(‘myfile.txt’) as my_file:
     file_lines = [x.rstrip(‘\n’) for x in my_file]
The with/as construction is a context manager, which provides an efficient way to instantiate an object for a block of code and then dispose of it outside that block. In this case, the object is my_file, instantiated with the open() function. This takes the place of several lines of boilerplate to open the file, read individual lines from it, then close it up.

The [x … for x in my_file] construction is another Python idiosyncrasy, the list comprehension. It lets an item that contains other items (here, my_file and the lines it contains) be iterated through, and it lets each iterated element (that is, each x) be processed and automatically appended to a list.

You could write such a thing as a formal for… loop in Python, much as you would in another language. The point is that Python has a way to economically express things like loops that iterate over multiple objects and perform a simple operation on each element in the loop, or to work with things that require explicit instantiation and disposal.

Constructions like this let Python developers balance terseness and readability.

Python’s other language features are meant to complement common use cases. Most modern object types—Unicode strings, for example—are built directly into the language. Data structures—like lists, dictionaries (i.e., hashmaps or key-value stores), tuples (for storing immutable collections of objects), and sets (for storing collections of unique objects)—are available as standard-issue items.