16 Facts about Python Programming that every Geek should know
Python course with 57 real-time projects - Learn Python
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:
- NASA
- Nokia
- IBM
- Yahoo! Maps
- Walt Disney Feature Animation
- Netflix
- Expedia
- Quora
- MIT
- Disqus
- Hike
- Spotify
- Udemy
- Shutterstock
- Uber
- Amazon
- Mozilla
- Dropbox
- Youtube
Technology is evolving rapidly!
Stay updated with DataFlair on WhatsApp!!
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’.
12. Antigravity!
If you get to the IDLE and type in import antigravity, it opens up a webpage with a comic about the antigravity module.
13. 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.
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.
Did you like this article? If Yes, please give DataFlair 5 Stars on Google
It is very useful to me and tq so much
Thanks for the feedback. Share the word on social media with your friends and colleagues.
swapping is 1 line statement:
a,b = b,a
Thanks for pointing it out. We have corrected the screenshot for swapping.
7 isn’t strictly true. You are returning a tuple. Parentheses are not necessary to delineate a tuple. Assignment of the output is also to a tuple, it’s just a tuple of names.
That is one way. You can also use a list, dictionary or object to return the values.
Hillo
Hiii,I want to know more about the python
Hi Harsha,
Refer to the sidebar for understanding all the concepts of Python programming and mastering the language. The Python tutorials are arranged in a sequential manner for better understanding. And, if you face any kind of difficulty while learning, share your queries with us. Our experts will assist you in the best possible way.
You post about some basic python
Hi Suprav,
We have a separate Python tutorial for learning the basics of Python programming. You can refer to it and strengthen your basics.
Yup I wanna add
Yes sure. You can post your views and suggestions here.
Python currently lives as the most beautiful language in the IT industry. If you are a beginner and love programming then you should prefer “Python” over any other languages.
Yes, you are absolutely right. Keep visiting DataFlair for regular updates on Data Science and Big Data world.
what a good tutorial thank u.. this a good website to learn python, i will recommended my friend
I just can’t stop laughing when I saw swapping code ….. Thanks, data-flair team for making python journey
easy and enjoyable.
It’s good
import antigravity and import this were fun to discover.
hola buenas muy buen tutorial a darle con todo a Python
It’s very useful to me.. thank you so much..
Interesting
it’s really interesting
Thank you so much for providing great start for python journey
Good tutorial