Let’s start the coding in python.

If you have not yet installed Python go here.

To know what Python is, go here.

Python is a very simple programming language.

We shall code the  “hello world” program in Python.

Python does not require to import any header file (if we speak in c++ language) or any module to your current program.

A Module is a set of pre written codes which are already saved in the system which can perform or which can support some special functions that we need to execute as we do our coding.

A Module is somewhat similar to the Header file in C++.

In order to print anything on the output page we just have to use the simple function ‘print()‘.

Unlike c++, we need not import any modules for inputting and outputting in python,

while in c++ ‘ #include<iostream.h>’ is used for the purpose (in case of C++ we used ‘cout’).

To start with, open the Python shell.

Python programming

For this you have to run the IDLE(Python 3.4 GUI-32 bit).

The opened window will look like this ↓

3.4.3 Shell

Actually this is where the RUN results are shown!.

Now click on ‘file’ and click on the ‘new file’ option.

Now we get a new file (look below Image⇓)

hello world

And this is where we code!.

Everything that is written after ‘ # ‘ is treated as a comment.

The first line of my code is a comment, stated as ‘ a hello world program ‘.

And then comes my simple code to print ‘ hello world’.

Here i invoked a ‘print’ function to obtain the output display “hello world” .
After the coding you have to just click the ‘run ‘ and then select the option ‘run module‘.

This can be easily done by pressing the ‘F5 button.

One thing to be taken care of is that we should always save the code before running it.

and once we do it ,

We will get the result on the ‘Python shell‘ window.

Comment in if you have any queries.

#Simple Coding 🙂

Advertisements