Introduction in python
What is Python
Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language.
Python features a dynamic type system and automatic memory management. It supports multiple programming paradigms, including object-oriented, imperative, functional and procedural, and has a large and comprehensive standard library.
History of Python
It was created by Guido van Rossum during 1985- 1990 and first released in 1991.
Python has a design philosophy that emphasizes code readability, and a syntax that allows programmers to express concepts in fewer lines of code, notably using significant whitespace.
Features of Python
Python is a multi-paradigm programming language. Object-oriented programming and structured programming are fully supported, and many of its features support functional programming and aspect-oriented programming (including by metaprogramming and metaobjects (magic methods)). Many other paradigms are supported via extensions, including design by contract and logic programming.
The language's core philosophy is summarized in the document The Zen of Python (PEP 20), which includes aphorisms such as:
- Beautiful is better than ugly
- Explicit is better than implicit
- Simple is better than complex
- Complex is better than complicated
- Readability counts
Advantages of Python
The Python language has diversified application in the software development companies such as in gaming, web frameworks and applications, language development, prototyping, graphic design applications, etc. This provides the language a higher plethora over other programming languages used in the industry. Some of its advantages are-
Extensive Support Libraries
It provides large standard libraries that include the areas like string operations, Internet, web service tools, operating system interfaces and protocols. Most of the highly used programming tasks are already scripted into it that limits the length of the codes to be written in Python.
Python integrates the Enterprise Application Integration that makes it easy to develop Web services by invoking COM or COBRA components. It has powerful control capabilities as it calls directly through C, C++ or Java via Jython. Python also processes XML and other markup languages as it can run on all modern operating systems through same byte code.
Improved Programmer’s Productivity
The language has extensive support libraries and clean object-oriented designs that increase two to ten fold of programmer’s productivity while using the languages like Java, VB, Perl, C, C++ and C#.
With its strong process integration features, unit testing framework and enhanced control capabilities contribute towards the increased speed for most applications and productivity of applications. It is a great option for building scalable multi-protocol network applications.
Disadvantages of Python
- Weak in Mobile Computing
- Gets Slow in Speed
- Run-time Errors
- Underdeveloped Database Access Layers
Similarities between Python and Ruby
- They both are high level language.
- They both are server side scripting language.
- Both are used for web applications.
- Both work on multiple platforms.
- Both have clean syntax and are easily readable.
- Both use an interactive prompt called irb.
- Objects are strongly and dynamically typed.
- Both use embedded doc tools
|Definition||Ruby is an open source web application programming language.||Python is a high level programming language.|
|Object Oriented||Fully object oriented programming language.||Not fully object oriented programming language.|
|Developer||Yukihiro Matsumoto in 1990s.||Guido Van Rossum in 1980s.|
|Developing Environment||EclipseIDE is supported.||multiple IDEs are supported.|
|Libraries||It has smaller library than Python.||Has larger range of libraries.|
|Mixins||Mixins are used.||Mixins can't be used.|
|Web frameworks||Ruby on Rails||Django|
|Community||Mainly focused on web.||Focussed in academia and Linux.|
|Usage||Apple Github Twitter Groupon Shopify ThemeForest||Google Instagram Mozilla Firefox The Washington post Yahoo Shopzilla|
|Built-in classes||Built-in classes can be modified||Built-in classes can't be modified|
|Unset a variable||Once a variable is set you can't unset it back . It will be present in the symbol table as long as it is in scope.||del statement help you to delete a set variable.|
|yield keyword||It will execute another function that has been passed as the final argument, then immediately resume.||It returns execution to the scope outside the function's invocation. External code is responsible for resuming the function.|
|Anonymous functions||Support blocks, procs and lambdas.||Support only lambdas.|
|Functions||Doesn't have functions.||It has functions.|
|Tuples||It doesn't support tuples.||It support tuples.|
|switch/case statement||It support switch/case statement.||It doesn't support switch/case statement.|
|lambda function||Its lambda functions are larger.||It support only single line lambda function.|
|Inheritance||Support single inheritance.||Support multiple inheritance.|