> Classes might not be what everybody needs but this pretending that hello world can be written in 1 line is just inviting people to write sloppy code.
IMV, sloppy unstructured code is a fine place for many (especially very young) programmers to start, and it simplifies the onramp significantly (and, actually, for simple scripts, relatively unstructured code in python is sufficient for lots of real-world uses, too.)
if __name__ == "__main__"
...is the k of thing you need only if you are deliberately designing something to be used as both a script and a library, which there are very good reasons to do for many real world python files, but it certainly is not universally necessary. And using classes for hello world is excessive Java-ism.
IMV, sloppy unstructured code is a fine place for many (especially very young) programmers to start, and it simplifies the onramp significantly (and, actually, for simple scripts, relatively unstructured code in python is sufficient for lots of real-world uses, too.)
...is the k of thing you need only if you are deliberately designing something to be used as both a script and a library, which there are very good reasons to do for many real world python files, but it certainly is not universally necessary. And using classes for hello world is excessive Java-ism.