Hello World in Python

Hello World in Python Featured Image

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

Python Background

In order to learn more about Python, I took to WikipediaOpens in a new tab. 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:

print("Hello, World!")

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 PythonOpens in a new tab.. After that, we should make sure we have the latest Python interpreterOpens in a new tab.. From there, we can simply run the following command in the terminal:

python hello-world.py

Alternatively, we can copy the solution into an online Python interpreterOpens in a new tab. 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!

Sample Programs in Every Language (44 Articles)—Series Navigation

For 100 Days of Code, I’ve decided to implement a few sample programs in as many languages as possible. Each implementation details a brief history of the language and a description of the code.

The plan for the series is to explore the major general-purpose language like Java, Python, C, C++, and C#. From there, we’ll take a look at some sample programs in web development languages like Ruby, PHP, and JavaScript. As we continue, we’ll cover proprietary languages like Swift and Objective-C. Eventually, we’ll start to tackle less popular languages like Rust, x86, and Verilog. Finally, we’ll play around with some of the esoteric languages like Brainf*ck and LOLCODE.

Who knows? Maybe the Sample Programs in Every Language series will become so popular it’ll never end. To help this series grow, consider sharing it on social media with your friends. Or, if you have a language you want to see, drop your suggestion in the comments.

Jeremy Grifski

Jeremy grew up in a small town where he enjoyed playing soccer and video games, practicing taekwondo, and trading Pokémon cards. Once out of the nest, he pursued a Bachelors in Computer Engineering with a minor in Game Design. After college, he spent about two years writing software for a major engineering company. Then, he earned a master's in Computer Science and Engineering. Today, he pursues a PhD in Engineering Education in order to ultimately land a teaching gig. In his spare time, Jeremy enjoys spending time with his wife, playing Overwatch and Phantasy Star Online 2, practicing trombone, watching Penguins hockey, and traveling the world.

Recent Posts