Let’s code in python !!!

Now that you have python installed in your systems we are all set to start programming in python.

So let’s begin !

In order to write a program/code you need an editor/IDE[Integrated Development Environment] to write on . So we will be using the python IDLE for now and later on we will switch to a better IDE where we will discuss the need to shift to a different IDE.

Today our aim is to get introduced to programming in python.So first of all open the python IDLE. Just search for IDLE and open the first option itself,

This slideshow requires JavaScript.

So this is the python shell where you can directly execute python commands.So let’s get started with the first python command.

We will first see how to print a statement in python. Type the command print (“your statement”) and press enter.The statement you wished to print is displayed. This is illustrated below.

1

If you have used C or Java before you might know to assign a value to a variable ,you will have to define the variable type first and then assign a value to it.But in python you directly say a=2  and python understands the data type by itself

 

3

So this shows why python is so easy to use.you don’t have to worry about variable declaration and neither semicolons. In C/C++ , semicolons are must after every statement whereas in python it is not required.

So I hope now you have got an idea of why python is easy.

Next time we will cover the conditional and loop statements in python.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s