lambda question

Alves, Carlos Alberto - Coelce calves at coelce.com.br
Mon Mar 11 12:06:51 EST 2002


Hi all,
Look at the two codes below

first code:

	f='x**3+2*x'
	list=[0,1,2,0]
	map(lambda x:eval(f),list)

second code:

	def exe1(f,list):
		return map(lambda x:eval(f),list)

Can someone explain to me why the first code works while second doesn't.

Carlos Alberto
COELCE/DPRON-Departamento de Projetos e Obras Norte
Fone: 677- 2228
e-mail: calves at coelce.com.br
\|||/
(o o)
--ooo0-(_)-0ooo--

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20020311/f43beadf/attachment.html>


More information about the Python-list mailing list