Python Logo

Python is a high-level programming language which is popular among software developers and has wide range of applications. Some of the reasons of popularity of Python include easy readability, conciseness, does more in relatively less lines of code than other popular programming languages and flexibility. Nowadays Python is widely used in the field of Data Science and Artificial Intelligence (AI). Python was created by Guido van Rossum and first appeared publicly on 20 February 1991.

Installing Python

Python 3 is the latest major release of Python which has a number of minor and micro releases under it. The latest release as on the date of this post is Python 3.12.2.

Installing Python 3 is simple. Grab the latest version of Python on the official website relevant to your operating system. Python supports various operating systems including Windows, macOS and Linux based operating systems.

On Windows, the installation can be done through the GUI for all users or the current user.

Installation Dialogue

On Linux based systems, installation could be done through package managers such as apt:

sudo apt-get install python3

Using Python

On installation, you can use python directly from the command line (using python) or from any IDE. For the rest of the post, we will be using the IDLE which comes bundled with your Python installation. IDLE is a simple IDE and great to start learning Python as a beginner.

First Program in Python: Hello World

So, without any further ado, let’s get started with our very first program in Python. As you know, any software performs some tasks and shows output on the screen. In Python, the print statement is used to show any output on the command line.

So our first program would look like this:

print ("Hello World!")

To type it in a file, open IDLE and press ‘Ctrl+N’ key to open a new file.

Yes that’s it! Let’s quickly execute it. To do so, press the ‘F5’ key while in IDLE or select ‘Run Module’ option from the ‘Run’ menu.

Note: You need to save your file before executing any program from IDLE.

Your results should look something like this:

First Program Output

Summary

To summarize, we covered some basic concepts about Python, its installation and writing your first program in Python. Our next post will take a further dive into some beginner-level concepts in Python. Thank you for reading.