function with variable arguments

Wolfram Kriesing wolfram.kriesing at gmail.com
Fri May 13 08:26:24 EDT 2005


> def Range(n,m=None,step=1):
>   if m is None:
>     n,m = 0,n+1
>   else:
>     n,m = n,m+1
>   return range(n,m,step)

i like this one. 

coming from php (just a couple weeks ago) its always again interesting
to see how i have to start thinking to program differently, it can be
so much easier with python. i dont want to go back to php!

-- 
cu

Wolfram



More information about the Python-list mailing list