16 Facts about Python Programming that every Geek should know
Free Python course with 25 real-time projects Start Now!!
Python ranked #1 on the IEEE Spectrum list of top programming languages for 2019. Today, we’ll take up some interesting facts about python programming to better understand what makes it so popular.
Python is getting popular, almost every industry is using it. It is the advice of experts to start learning python as soon as possible. That’s why DataFlair has launched an Online Python Training Course to become you the master of Python.
Interesting facts about Python Programming
Below are the 16 most interesting facts about Python Programming that you should know –
1. 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.
2. 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?
3. The Zen of Python
Tim Peters, a major contributor to the Python community, wrote this poem to highlight the philosophies of Python. If you type in “import this” in your Python IDLE, you’ll find this poem:
4. 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
5. Big Companies Using Python
Many big names use (or have used) Python for their products/services. Some of these are:
- Yahoo! Maps
- Walt Disney Feature Animation
What are you waiting for? Start learning Python now and build your career in it.
6. 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.
7. Functions can return multiple values
In Python, a function can return more than one value as a tuple. Take a look at the following code:
This isn’t possible in a language like Java. There, you can return an array of values instead.
8. 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:
Learn in detail about Python variables and data types
9. With slicing, it’s easier to reverse a list
If we slice a list of values from starting to end but with a step of -1, we get the list right to left (reversed).
10. You can chain comparison
Conditions may contain more than one comparison at once. You can have a condition that checks whether a value is greater than another and lesser than yet another all at once.
11. String literals concatenate together
If you type in string literals separated by a space, Python concatenates them together. So, ‘Hello’ ‘World’ becomes ‘HelloWorld’.
If you get to the IDLE and type in import antigravity, it opens up a webpage with a comic about the antigravity module.
14. for- and while- loops can have else statements
The else statement is not limited to if and try statements. If you add an else block after a for- or while- loop, the statements inside the else block are executed only after the loop completes normally. If the loop raises an exception or reaches a break statement, the code under else does not execute. This can be good for search operations.
Python Loops – Detailed guide
15. _ gets the value of the last expression
Many people use the IDLE as a calculator. To get the value/result of the last expression, use an underscore.
16. People prefer Python over French
According to a recent survey, in the UK in 2015, Python overtook French to be the most popular language taught in primary schools. Out of 10, 6 parents preferred their children to learn Python over French. One of my favorite facts about Python programming.
Hope you had fun finding out new things about Python. Do you want to add to the list? Comment below.
To learn more about Python you can refer to our online python course designed by experts.