On 12/2/10 11:49 AM, Dawes, Andrew M. wrote:
On 12/2/10 8:01 AM, Jason Grout wrote:
On 12/2/10 8:24 AM, Andrew Dawes wrote:
lambda is a special word in python, it indicates a type of one-line
function definition. Using any other word should work.
See:
http://groups.google.com/group/sage-support/browse_thread/thread/728f27989ff87203/4b08aaaed8309cbc?q=sage+support+lambda
for a similar discussion.
For more on lambda functions (very useful by the way) see:
http://diveintopython.org/power_of_introspection/lambda_functions.html
I usually do:
lambda_=var("lambda_"), which still prints a Greek lambda when I output
it in typeset form.
Jason
Thanks, that's a good tip, I was curious if there was a way to bypass
the keyword and still get the greek letter.
if it's not too confusing, you could also do:
sage: l=var("lambda")
sage: l
lambda
sage: l^2-l-2
lambda^2 - lambda - 2
sage: latex(l^2-l-2)
\lambda^{2} - \lambda - 2
Then when Sage prints out the variable, it will print out "lambda", but
when you want to use it, you'll type l. Sometimes I do
llambda=var("lambda") or something like that instead.
Jason
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org