Welcome to the first edition of the Hello World in Every Language series where I plan to embark on a journey of coding language exploration. First up, how to implement Hello World in Python. Let’s dive in!
Table of Contents
In order to learn more about Python, I took to Wikipedia for some background.
According to Wikipedia, Python is an interpreted general-purposed language that was created by Guido van Rossum, a Dutch programmer, in 1991. Apparently, Python was inspired by ABC, an imperative general-purpose language.
Since 1991, Python has had two major upgrades: Python 2.0 and Python 3.0. In October 2000, Python 2.0 was released. Over eight years later, Python 3.0 was released. Currently, the community supports both versions of Python. But, Python 2 is slowly losing support.
Hello World in Python
I chose Python to start as it has probably the easiest and most readable Hello World implementation in the realm of programming languages:
And, we’re done. In fact, we don’t even have to compile anything. If we’re in the interpreter, we’ll print right away. Otherwise, we can easily call the script from the command line to get our result.
As you can probably imagine, this code works because Python has a built-in function called print. By passing that function a string, the interpreter is able to call the Python libraries that make the print possible.
How to Run the Solution
If we want to run this program, we should probably download a copy of Hello World in Python. After that, we should make sure we have the latest Python interpreter. From there, we can simply run the following command in the terminal:
Alternatively, we can copy the solution into an online Python interpreter and hit run.
Sample Programs in Every Language
As you can probably tell be the heading, the plan for this series is to implement Hello World in as many languages as possible.
So far, my rough plan is to start with the general-purpose industrial languages: C/C++, C#, Python, and Java. Then, we’ll likely dive into more web-based languages like Ruby and PHP. After that, we’ll probably start exploring fringe languages like x86, COBOL, and Fortran. Finally, we’ll dive into the esoteric languages like LOLCODE and everyone’s favorite, Brainf*ck.
Next, we’ll take a look at how to implement Hello World in Java. Stay tuned!