• When write to global variable in function, declare the variable as global ... at the first line of function definition.
  • Conditions can be chained(!!). 1 < a < 3 checks that a is both less than 3 and more than 1.
  • If you want to execute python code without starting a new console(in windows), change python file extension’s name to “pyw”. This is useful for GUI applications.
  • __import__ function can import modules dynamically.
  • multi parameter function:
    • def f(*a): all parameters in list a
    • def f(**a): all parameters in dict a (should be called in this way: f(a=1,b=2))
    • When using python’s iterative shell, _ variable stores return value of last command.