Friday 5 December 2014

Hello World Program


STEP 1:


Open LXTerminal.

Create a file with .py extension

Ex: nano helloworld.py

Nano is a type of editor used to write the code in that file named helloworld.

Type the following code in that file by insert key or by typing letter I on keyboard.

Program:

#! /usr/bin/python                   //To ensure the correct interpreter used.
#print Hello World                 //comment line.
 print “Hello World”              //command to print the statement.

Save the file by typing  :wq and then press enter

To see the output type the following command

Ex: sudo python helloworld.py

Output:

0 comments:

Post a Comment