Monday, October 26, 2009

To be noted...

how to organise your program...
  • use 4 spaces for indentation
  • imports should go at the top of the file
  • separate function definitions with two blank lines
  • keep function definitions together
  • keep top level statements, including function calls, together at the bottom of the program
rules of "and" and "or" operators...
  • all values are true: 
    and returns last value
    or returns first value
    • false and true values: 
    and returns the first false value
    or returns the first true value
    • all values are false:
    and returns first value
    or returns last value

    No comments:

    Post a Comment