Archive for April 3rd, 2013

If Statement is a conditional that python will check before taking a new action. If statement result is TRUE, python will process the command given otherwise it will ignore and execute the next step.

The syntax is:
if statement:

Let’s try.
>>> myprogramming_language=’python’
>>> if myprogramming_language==’python’:
print “Python is my programming language”

Python is my programming language

myprogramming_language=’python’ will tell python, please enter variable myprogramming_language with value python.

if myprogramming_language==’python’: will tell python, if myprogramming_language is equal with ‘python’ then execute the next line, otherwise just ignore and continue to the next step.

If it’s equal mean the condition is True.

If it’s not equal the condition is False.


Read Full Post »


Get every new post delivered to your Inbox.

Join 81 other followers