In [1]:
# conditions
# conditions work on truth of false of a statement.
5 > 2
Out[1]:
In [2]:
2 > 5
Out[2]:
In [3]:
#booleans
print type(True),type(False)
In [4]:
# if your statement is true you go the block.
if 5 > 2:
print "5 is greater than 2"
In [ ]:
# if your statement is not true you dont go into the block.
if 2 > 5:
print "2 is greater than 5"
In [5]:
if 2 > 5:
print "2 is greater than 5"
else:
print "2 is lesser than 5"
In [ ]:
# pep - https://www.python.org/dev/peps/
# pep8 - https://www.python.org/dev/peps/pep-0008/#indentation
# pycon video - https://www.youtube.com/watch?v=wf-BqAjZb8M