Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 7 years ago

fidbc gravatar image

Would

[n(x) for x in ( sin(1), cos(1), pi/4 )]

count as a single command? If L is the list of numbers, say L=( sin(1), cos(1), pi/4) to ( sin(1).n() , cos(1).n() , pi/4.n() ), then map(n,L) should do the job.

click to hide/show revision 2
No.2 Revision

Would

[n(x) for x in ( sin(1), cos(1), pi/4 )]

count as a single command? If L is the list of numbers, say L=( sin(1), cos(1), pi/4) to ( sin(1).n() , cos(1).n() , pi/4.n() )pi/4), then map(n,L) should do the job.