subexpressions

Sergey Dorofeev sergey at fidoman.ru
Fri Jun 1 03:51:36 EDT 2007


Hello all!

Please help, is there way to use sub-expressions in lambda?
For example, if I want to calculate sin(x^2)+cos(x^2) I must code:
lambda x: sin(x*x)+cos(x*x)
How to make x*x to be evaluated once?





More information about the Python-list mailing list