Python Overview
Python Overview
Python is a high-level, interpreted, interactive, object-oriented scripting language. Python is designed to be extremely easy to understand. It frequently uses English keywords rather than punctuation, and its syntax is more concise than that of other languages.
- Python is interpreted – Python is processed by an interpreter at runtime. You do not need to compile your program before executing it. This is similar to PERL and PHP.
-
Python is interactive – You can write programs directly from the Python prompt by interacting with the interpreter.
-
Python is object-oriented – Python supports object-oriented programming, a style or technique where code is encapsulated in objects.
-
Python is an entry-level language – Python is an ideal language for beginning programmers and supports the development of a wide range of applications, from simple text processing to web browsers to games.
Python is an open-source, cross-platform programming language. It is available on all major operating systems (Linux, Windows, and Mac OS) under the Python Software Foundation License (compatible with the GNU General Public License).
Python’s design philosophy emphasizes simplicity, readability, and clarity. Python is known for its “batteries included” approach, as Python software comes with a standard library containing a rich set of functions and modules.
Python’s design philosophy is documented in “The Zen of Python.” It includes 19 aphorisms, such as –
- Beauty is better than ugliness
- Explicit is better than implicit
- Simplicity is better than complexity
- Complexity is better than obscurity
For the complete “Zen of Python” document, enter import this in the Python shell.
>>>import this
This will produce the following 19 maxims –
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it might be a good idea.
Namespaces are one honking great idea -- let's do more of those!
Python supports imperative, structured, and object-oriented programming styles. It also provides functional programming features.