Python is one of the most efficient, and easy to learn programming language with the simplest syntax. Python has the following two versions:
- Python 2
- Python 3
There is a major difference between python 2 and python 3. For instance, one difference is the print statement. In python 2, the print statement is not a function. It is considered as a simple statement. Whenever we use the print statement in python 2, we do not use the parenthesis. On the other hand in python 3, print is a function and it is followed by the parenthesis.
In any programming language, the simplest â€œHello Worldâ€ program is used to demonstrate the syntax of the programming language. In this article, we create the â€œHello Worldâ€ program in python 3. Spyder3 editor is used to creating and running the python script.
Creating a Hello World Program
For creating the Hello World program, you will need to perform the following steps
- Open the Spyder3 editor.
- Go to the â€œFileâ€ menu and click on â€œNew Fileâ€. A new python file will be created.
- Now simply write the program print(â€œHello Worldâ€)
- Click on the â€œRunâ€ button.
- After clicking on the â€œRunâ€ button, a window will be prompted. Type the name of the file that you want to assign to this file. We give the â€œHello Worldâ€ name to file. After that, choose the directory where you want to save this file and click on the â€œSaveâ€ button.
- If you are running a spyder3 editor for the first time, then you have to run the setting for your newly created python script. In the console, the menu chooses â€œExecute in current consoleâ€ and in the working directory settings menu choose the first option â€œThe directory of the file being executedâ€ and click on the â€œRunâ€ button.
- Finally, you can see the output â€œHello Worldâ€ on the console.
In this article, we have described how you can create your first program â€œHello Worldâ€ in python. By following the steps described in this article you can easily create the â€œHello Worldâ€ program.