Python Forum

Full Version: First python program?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Found a book on python. Since people around here think real programmers use python, I started to read it.

The book explained that the language is named for Monty Python. That got this geek's attention!

The next page proposed your first python program:

print('Hello, world!')
print(2**100)
Really? No way! Your first python program should be:

print('Your mother was a hamster and your father smelt of elderberries!')
print(2**100)
I'm an old computer science dude looking to learn some new technologies.
(Jan-02-2019, 02:53 PM)Tentoes Wrote: [ -> ]Since people around here think real programmers use python
Thats because real programmer do use python. Rolleyes

most books and tutorials will use spam and eggs vs the usual foo and bar

in the docs it even says using monty python refs are encouraged
Quote:By the way, the language is named after the BBC show “Monty Python’s Flying Circus” and has nothing to do with reptiles. Making references to Monty Python skits in documentation is not only allowed, it is encouraged!

There are also a lot of easter eggs in python.
>>> import __hello__
Hello world!
>>> from __future__ import braces
  File "<stdin>", line 1
SyntaxError: not a chance
>>> 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!
>>> import antigravity
Output:
opens your browser to https://xkcd.com/353/
In the heroic age of the Python language, the python package index (Pypi) was called the cheeseshop in reference to the Monty Python's sketch. I guess it was before some serious programmers decided that this looked a little amateurish. I miss those days!

@metulburr You need to update your links to 3.7!
(Jan-02-2019, 02:53 PM)Tentoes Wrote: [ -> ]Since people around here think real programmers use python

Come on, everyone knows that real programmers use butterflies.
The zen of python looks like my decades old programming philosophy. We'll get along well.

Roaring with laughter (ok, I exaggerate)

My rank is "Unladen swallow"!
(Jan-02-2019, 05:45 PM)Tentoes Wrote: [ -> ]My rank is "Unladen swallow"!

For now.
Ichabod, to you I say, "y2."
Quote:I'm an old computer science dude looking to learn some new technologies.
There are several old dudes here, my first software job was 1968.
(Jan-03-2019, 03:09 PM)Larz60+ Wrote: [ -> ]
Quote:I'm an old computer science dude looking to learn some new technologies.
There are several old dudes here, my first software job was 1968.

Ok. I turned 10 in 1968. You have me beat.