If / ElseΒΆ

The form of an if...else block is slightly different in Python from other C based languages.

NOTE: There is no switch statement in Python.

>>> x = 42
>>> if x < 0:
...     print "less"
... elif x == 0:
...     print "equal"
... else:
...     print "greater"
...
greater