On 11/2/11 12:16 PM, Jamie Mulholland wrote:
Could use the map command:

sage: a(n)=n^2
sage: map(a,[1,2,3])
[1,4,9]


Or list comprehensions:

[n^2 for n in [1,2,3]]

or

[a(n) for n in [1,2,3]]

-Jason

--
You received this message because you are subscribed to the Google Groups 
"sage-edu" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-edu?hl=en.

Reply via email to