Python has become the most popular programming language in the world. It is used in a variety of fields. Here are some of the interesting and fun facts about ‘Python’ that will surely blow your mind.
- The name of ‘Python’ is not related to snakes anyhow. The creator of Python ‘Guido Van Rossum’ was a big fan of the British Comedy troupe Monty Python. That’s why he named the language ‘Python’!
- If you type in “import this” in your Python IDLE, this poem will appear:
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.
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!
- Unlike C, C++, or PHP, Python does not use braces to create a scope. Instead of braces, python uses indentation for scope creation. If you choose to import it from the __future__ package, it gives you a witty error.
from __future__ import braces
SyntaxError: not a chance
- In Python, a function can return more than one value in the form of a tuple!
- If you get to the IDLE and type in import antigravity, it opens up a webpage with a comic about the antigravity module!
- Python does not support pointers. In Python, every program is done by reference. It does not support the pointer!
- Some people think python is a new language, but the fact is Python is a very old language. A lot older than ‘Java’!
- Python was a hobby project. Its creator Guido Van Rossum was looking for a hobby project to keep him occupied in the week around Christmas!
- Many big companies use Python for their products/services. Some of these companies are NASA, Google, Facebook, Netflix, Expedia, Quora, Reddit, Amazon, Pinterest
- Unlike any other programming language, Python uses else for loops too. The else part would be executed only if the loop raises no exception and does not break!
- In python, we can define multiple variables at once!
- Believe it or not, in 2015, Python overtook French to be the most popular language taught in primary schools. According to stats, 6 out of 10 parents preferred their children to learn Python instead of French!
- Did you know, ‘Brython’ is one the variants of python that runs on a web browser!