
Hello! Today is February 20th, which means that today is the birth of the Python programming language! Today, Python is 27 years old. Over the years, Python has become one of the most popular programming languages ​​in the world. Well, I wish further development and conquest of new heights of Python. In honor of today's birthday, below is a selection of interesting facts about Python. If you are interested, welcome under the cat! Read the facts, share your facts in the comments, or just have fun. After all, today is a holiday :)
1. "The Zen of Python"
Well, how not to start the selection of facts without
')
"The Zen of Python"? :)Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than difficult.
Complicated is better than confusing.
Flat is better than nested.
Sparse is better than dense.
Readability matters.
Special cases are not so special as to break the rules.
At the same time, practicality is more important than perfection.
Errors should never be hushed up.
If not silenced explicitly.
Faced with ambiguity, resist the temptation to guess.
There must be one - and, preferably, only one - obvious way to do this.
Although at first it may not be obvious if you are not Dutch [11].
Now is better than never.
Although never often better than right now.
If the implementation is difficult to explain, the idea is bad.
If the implementation is easy to explain, the idea is probably good.
Namespaces are great! We will do them more!
2. The name "Python"
Probably not everyone knows that the language was not named after a snake. The creator of the language, Guido van Rossum, was a fan of the British comedy show Monty Python's Flying Circus. So in honor of "Monty Python (Monty Python)" the language was called Python. And now some fantasies: what if Guido called the language "Monty Python"? :)
3. Who and how uses Python
Just leave
this link here.
4. And now, “The Zen of Python” in the original
We start the Python interpreter, import the “this” library and
rejoice:>>> import this 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!
5. Antigravity
Want to feel antigravity? In the interpreter type: "import antigravity"
6. Cross-platform, interactive, interpretable
cross-platform, because Python runs on almost all known operating systems, including: Linux, Window, FreeBSD, Macintosh, Solaris, etc.
interactive because it allows real-time interaction with the interpreter. Below is an example:
>>> 6 + 2 8 >>> a = 'Hello world' >>> a 'Hello world' >>> >>> def b(): return(1, 2, 3) >>> b() (1, 2, 3) >>> >>> c = 'Pyth' >>> d = 'on' >>> c + d 'Python' >>>
interpretable because it does not require compilations to execute code
7. Braces
As you know, curly braces are not in great demand in Python, unlike C ++
, Java, etc. There is even a joke about curly braces:
>>> from __future__ import braces SyntaxError: not a chance
not a chance :)
Bye for now! I tried to write about the most fun moments without going into the interior of Python. Hope you enjoyed it!
And of course:
Happy Birthday, Python! :)