Control Flow Statements
If-else
if expression:
statement(s)
elif expression:
statement(s)
elif expression:
statement(s)
...
else:
statement(s)
Python does not have a switch statement.
while expression:
statement(s)
for target in iterable:
statement(s)
Python provides built-in functions range() and xrange() to generate and return integer sequences.
range(x) returns a list whose items are consecutive integers from 0 (included) up to x (excluded).
range(x, y) returns a list whose items are consecutive integers from x (included) up to y (excluded).
List comprehensions
[ expression for target in iterable lc-clauses ]
[x+1 for x in some_sequence if x>23]
[x+y for x in alist for y in another]