Writing Your First “Hello, World” Python Program

In this tutorial, we are using JetBrains PyCharm Editor To write “Hello, World” program in python. PyCharm is very popular among all IDE and supported to various platforms like Windows, Mac, Linux etc.

Creating First Python Program

Step 2: After the completed Installation process, You will see Icon in your System Start menu. Open PyCharm Editor ->click on create a new project.

Step 3:Agree Terms and Conditions and Select the UI theme for which you want to write your first program. I suggest Dracula Theme one of my favorite, which useful for Night vision.

Step 4: You will need to select a location and set the PATH.

You can select the location where you want the project to be created. If you don’t want to change location than keep it as it is but at least changes the name from “untitled” to something more meaningful, like “FirstProject”.

Note that, PyCharm should have found the Python interpreter you installed earlier. You can download latest python version from the official website

Check our previous tutorial to learn how to install and setup python on windows, Linux and mac.

If you are running the older version of Python (Python 2.x), use of parenthesis as inprint function is optional. This produces the following result:

1

Hello,Python!

The prompt should reappear to let you know that the Python shell is ready to accept more commands.

Congratulations! You’ve just created your first Python program. The word print is a type of Python command called a function, and it prints out whatever is inside the parentheses to the screen. In essence, you have given the computer an instruction to display the words “Hello World”—an instruction that both you and the computer can understand.

Whenever you are done in the python command line, you can simply type the following “exit()” to quit the python command line interface: