Interesting facts about Python or “Happy Birthday, Python!”

    image

    Hello! Today is February 20th, which means today is the day the Python programming language came into existence! Python is turning 27 today. Over the years, Python has become one of the most popular programming languages ​​in the world. Well, I wish you 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 to kat! 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 can you not begin the selection of facts without

    "The Zen of Python"? :)
    Beautiful is better than ugly.
    Explicit is better than implicit.
    Simple is better than complex.
    Complex is better than intricate.
    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 impeccability.
    Mistakes should never be hushed up.
    If not hushed up explicitly.
    When faced with ambiguity, discard 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].
    Better now 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 a good one.
    Namespaces are a great thing! We will make them bigger!

    2. The name "Python"


    Probably not everyone knows that the language was not named after the 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)" language called Python. And now a little fantasy: 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 library "this" 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 anti-gravity? In the interpreter type: "import antigravity"

    6. Cross-platform, interactive, interpreted


    cross-platform, because Python works on almost all well-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'
    >>>

    interpreted because it does not require compilation 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 :)

    That's all for now! I tried to write about the funniest moments without going deeper into Python. I hope you enjoyed it!

    And of course: Happy Birthday, Python! :)

    Also popular now: