2015/05/25

Python notes for week 3

Operator precedence
not (highest)
and
or (lowest)

you can convert between int, str and float, for example
>>> five = str(5)
>>> five
'5'
>>> int (five*5)
55555
>>> float(int(five*3))
555.0

module: a file containing function definitions and other statements.
Module math is part of Python, and contains functions that are math-related.

if statement:
if expression :
  statements
elif expression :     (0 or more elif clauses)
  statements
else expression :    (0 or 1 else clauses ; if it exists, it muse be the last clause)
  statements