blog posts

python programming

Important Facts of Python programming

In this article i want to talk about the Essential facts of python programming

Important facts about Python Programming

Below are the  most interesting facts about Python Programming that you should know.

Python was a hobby project

In December 1989, Python’s creator Guido Van Rossum was looking for a hobby project to keep him occupied in the week around Christmas. He had been thinking of writing a new scripting language that’d be a descendant of ABC and also appeal to Unix/C hackers. He chose to call it Python. and

One of the amazing features of Python is the fact that it is actually one person’s work. Usually, new programming languages are developed and published by large companies employing lots of professionals, and due to copyright rules, it is very hard to name any of the people involved in the project. Python is an exception.

Python wasn’t created as a need for a new programming language. It originated as a pastime during holidays. In December 1989, Python’s creator Guido Van Rossum was looking for a hobby project to keep him occupied in the week around Christmas. He had been thinking of writing a new scripting language that’d be a descendent of ABC and also appeal to Unix/C hackers. He chose to call it Python.

Why it was called Python

The language’s name isn’t about snakes, but about the popular British comedy troupe Monty Python (from the 1970s). Guido himself is a big fan of Monty Python’s Flying Circus. Being in a rather irreverent mood, he named the project ‘Python’. Isn’t it an interesting Python fact?

Flavors of Python

Python ships in various flavors:

  • CPython Written in C, most common implementation of Python
  • Jython- Written in Java, compiles to bytecode
  • IronPython- Implemented in C#, an extensibility layer to frameworks written in .NET
  • Brython- Browser Python, runs in the browser
  • RubyPython- Bridge between Python and Ruby interpreters
  • PyPy- Implemented in Python
  • MicroPython- Runs on a microcontroller

 

Big Companies Using Python

Many big names use (or have used) Python for their products/services. Some of these are:

  • NASA
  • Google
  • Nokia
  • IBM
  • Yahoo! Maps
  • Walt Disney Feature Animation
  • Facebook
  • Netflix
  • Expedia
  • Reddit
  • Quora
  • MIT
  • Disqus
  • Hike
  • Spotify
  • Udemy
  • Shutterstock
  • Uber
  • Amazon
  • Mozilla
  • Dropbox
  • Pinterest
  • Youtube

No braces

Unlike Java and C++, Python does not use braces to delimit code. Indentation is mandatory with Python. If you choose to import it from the __future__ package, it gives you a witty error.

Functions can return multiple values

In Python, a function can return more than one value as a tuple.

Python supports multiple assignments in one statement

Python will let you assign the same value to multiple variables in one statement. It will also let you assign values to multiple variables at once.

This also means swapping in Python is quicker and can be done in only 1 line of code.

Python influenced JavaScript

Python is one of the 9 languages that influenced the design of JavaScript. Others include AWK, C, HyperTalk, Java, Lua, Perl, Scheme, and Self.

The Zen Of Python

Programming is an art, they keep on saying! Python actually proves it.

There is actually a poem written by Tim Peters (a major contributor to the Python community) named “THE ZEN OF PYTHON” which can be read by just typing “import this” in your Python IDLE:

 

Input:

import this

Output:

The Zen of Python, by Tim Peters

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 may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

Python is Older Than Java

The programming language of Python is very high in demand over the past decade. So it seems that Python is a new language that has attracted and strengthened its listeners.

But here’s the interesting truth: Python is an old programming language and much older than Java. Python was first released in 1991 whereas Java was released in 1995. Today, Python is 30 years old but still stands strong for the future.

Python is Not Slow

Python is like a Swiss army knife for programmers. However, some developers continue to claim that even though Python is very easy to learn because of its simple syntax…but it is simply too slow.

But the question is: “If Python would have been slow then why would companies like Instagram, NASA, IBM, Google, Youtube use Python?”

Cuong Do, Software Architect at YouTube said, “Python is fast enough for our site and allows us to produce maintainable features in record times, with a minimum of developers.”

And then there’s another from Peter Norvig, Google’s Director of search quality:

Python has been an important part of Google since the beginning, and remains so as the system grows and evolves. Today dozens of Google engineers use Python, and we’re looking for more people with skills in this language.”

Python is indeed a little bit slower than compared to other programming languages like C, C++, Java, etc…because they are compiled languages whereas Python is interpreted. Thus, this gives a slightly slower speed.

But remember the fact that Python is slower, doesn’t affect its increasing popularity and high demand in big tech companies. As Robert Lloyd summed up the best: “Slow and steady wins the race.”