Jul 082009

Python functions have no explicit begin or end, and no curly braces to mark where the function code starts and stops. The only delimiter is a colon (:) and the indentation of the code itself.
This corresponds with def and if etc.
For example,

def fib(n): [...]

Posted by weboom at 6:16 am Tagged with: , ,
Jun 252009

def
is to define function in Python.
—-
def  square(x):
return x*x

Posted by weboom at 7:22 pm Tagged with: ,
Switch to our mobile site
Top Footer