Python – Hello World

  • Step 1 (Download Python IDLE):
    Python is downloaded for free. To download Python, go to http://www.python.org/downloads this link and download the latest (3.6.1) version, any version can be downloaded as per your requirement.
  • Step 2 (Installing Python):
    After downloading, install the downloaded file by double clicking it.
  • Step 3 (Open Python IDLE):
    Go to the path where it has been installed and open it.
  • Step 4 (Python Program in Shell):
    Write Python’s simple program in Shell.
  • Step 5 (Create .py file):
    To save python program on your computer despite Shell, go to file menu in Shell and click new (Ctrl + N) and write your program. Ctrl + S or file to save Click on the save button. After that name will be set to default with .py. Even if extension is given, there is no problem. new.py
  • Step 6 (Run .py file): After saving
    Python file, use Run Module or F5 in Run to run it.

‘Hello World’ Program in Python

In shell
>>> print ("Hello World") 
Hello World #Output
Save new.py
print ("Hello World")
Output:
Hello World
Difference Between Version 2.7.x and Version 3.xx

In 2.7.x

In Python 2.7.x, print does not have this function.
print "Hello World" 
a = 1/2 
print a
Output:
Hello World 
0

In 3.xx

In Python 3.cx, print () is the function.
print "Hello World" 
a = 1/2 
print a
Output:
Hello World 
0.5