>>> def f(x): return x+4
>>> map(f, [1,2,3,3,70])
[5, 6, 7, 7, 74]
Cyril
On 2/28/06, Ronny Mandal <[EMAIL PROTECTED]> wrote:
Assume you have a mathematical function, e.g. f(x) = x + 4
To calculate all the values from 1 to n, a loop is one alternative.
But to make this function work with vectors instead i.e
f(x_vector) = result_vector,
how should the function then be implemented?
Thanks
RM
--
Support bacteria - it's the only culture some people have!
--
http://mail.python.org/mailman/listinfo/python-list
-- http://mail.python.org/mailman/listinfo/python-list